/* ==========================================================================
   PHANTOM AUTOMATE CORE DESIGN SYSTEM (Vanilla CSS Glassmorphism Dark Mode)
   ========================================================================== */

/* Variables */
:root {
  --bg-dark: #f8fafc;
  --bg-darker: #f1f5f9;
  --panel-bg: #ffffff;
  --panel-border: #e2e8f0;
  --panel-border-glow: rgba(13, 148, 136, 0.15);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-muted-dark: #94a3b8;
  
  --accent-primary: #0d9488;
  --accent-primary-hover: #0f766e;
  --accent-secondary: #14b8a6;
  --accent-success: #10b981; /* Emerald */
  --accent-warning: #f59e0b; /* Amber */
  --accent-danger: #ef4444; /* Rose Red */
  
  --font-outfit: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --shadow-glow: none;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  /* overflow-x: hidden removed — Chrome treats position:fixed as body-relative when set here, breaking dropdown z-index */
}

/* Ambient Glow Backgrounds */
.glow-bg {
  display: none !important;
}

.glow-1 {
  background: radial-gradient(circle, var(--accent-primary) 0%, rgba(0,0,0,0) 70%);
  top: -10%;
  left: -10%;
}

.glow-2 {
  background: radial-gradient(circle, var(--accent-secondary) 0%, rgba(0,0,0,0) 70%);
  bottom: -10%;
  right: -10%;
}

.glow-3 {
  background: radial-gradient(circle, #ec4899 0%, rgba(0,0,0,0) 70%);
  top: 40%;
  left: 45%;
  width: 400px;
  height: 400px;
  opacity: 0.15;
}

/* Typography Utilities */
.font-outfit {
  font-family: var(--font-outfit);
}

.text-accent {
  color: var(--accent-secondary);
}

.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.mb-0 { margin-bottom: 0; }
.flex-grow-max { flex-grow: 1; }
.max-w-sm { max-w: 380px; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-outfit);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-normal);
  outline: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.15);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.25);
  background: var(--accent-primary-hover);
}

.btn-primary:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #0f172a;
  color: #0f172a;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.05);
  border-color: #0f172a;
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-danger:hover {
  background: var(--accent-danger);
  color: #fff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--border-radius-sm);
}

.btn-block {
  display: width;
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

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

.align-center {
  align-items: center;
}

.form-group label {
  font-family: var(--font-outfit);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-main);
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--panel-border-glow);
  background: #ffffff;
}

/* App Main Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow-x: hidden; /* Moved from body — safe here as it only clips #app content, not fixed-position descendants */
}

.view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* AUTHENTICATION PAGE */
#auth-page {
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-glow);
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.brand-icon {
  font-size: 24px;
  margin-right: 8px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 10px;
}

.brand-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-header h2 {
  font-family: var(--font-outfit);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 25px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
}

.auth-footer a:hover {
  text-decoration: underline;
  color: var(--accent-primary-hover);
}

/* WORKSPACE VIEW */
.navbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--panel-border);
  z-index: 10;
  position: sticky;
  top: 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.navbar-actions {
  display: flex;
  align-items: center;
}

.user-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: 20px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.workspace-body {
  flex: 1;
  display: flex;
  position: relative;
}

.workspace-sidebar {
  width: 250px;
  border-right: 1px solid var(--panel-border);
  background: var(--bg-darker);
  padding: 30px 20px;
  position: relative;
}

.sidebar-section {
  margin-bottom: 30px;
}

.sidebar-title {
  font-family: var(--font-outfit);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted-dark);
  text-transform: lowercase;
  font-variant: small-caps;
  margin-bottom: 15px;
  padding-left: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-outfit);
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-normal);
  margin-bottom: 6px;
}

.sidebar-link .link-icon {
  margin-right: 10px;
  font-size: 16px;
}

.sidebar-link:hover {
  color: var(--text-main);
  background: rgba(13, 148, 136, 0.05);
}

.sidebar-link.active {
  color: #fff;
  background: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.15);
}

.workspace-content {
  flex: 1;
  padding: 40px 50px;
  overflow-y: auto;
  max-height: calc(100vh - 70px);
  position: relative; /* Creates explicit stacking context so Chrome compositor respects z-index ordering */
  z-index: 0;
}

.subview {
  animation: fadeIn 0.35s ease-out;
}

/* Dashboard Headers */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 35px;
}

.page-title {
  font-family: var(--font-outfit);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* Alert Banner */
.alert-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--border-radius-md);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  animation: fadeIn 0.4s ease-out;
}

.alert-icon {
  font-size: 20px;
  margin-right: 15px;
}

.alert-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.alert-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.alert-close:hover {
  color: var(--text-main);
}

/* Templates grid and cards */
.templates-section {
  position: relative;
}

.section-title {
  font-family: var(--font-outfit);
  font-size: 14px;
  font-weight: 700;
  text-transform: lowercase;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--text-muted-dark);
  margin-bottom: 20px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.no-templates {
  grid-column: 1 / -1;
  background: var(--panel-bg);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius-lg);
  padding: 50px;
  text-align: center;
  color: var(--text-muted);
}

.no-templates p {
  margin-bottom: 20px;
  font-size: 15px;
}

.template-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-glow);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 220px;
  position: relative;
}

.template-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06), 0 0 15px var(--panel-border-glow);
}

.card-badge {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 20px;
}

.badge-owner {
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.25);
  color: var(--accent-primary);
}

.badge-shared {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-success);
}

.template-card-header {
  margin-bottom: 15px;
  padding-right: 60px;
}

.template-card-title {
  font-family: var(--font-outfit);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-card-owner {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.1s ease;
}

.template-card-owner:hover {
  color: var(--text-main);
}

.template-card-owner:active {
  transform: scale(0.98);
}

.template-card-owner .copy-icon {
  font-style: normal;
  opacity: 0.6;
  font-size: 10px;
  transition: opacity 0.2s ease;
}

.template-card-owner:hover .copy-icon {
  opacity: 1;
}

.template-card-meta {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
}

.rules-count {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.rules-count-icon {
  margin-right: 6px;
}

.template-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.template-card-actions button {
  flex: 1;
}

/* VISUAL MAPPING STUDIO */
.studio-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-lg);
  padding: 35px;
  box-shadow: var(--shadow-glow);
}

.card-title {
  font-family: var(--font-outfit);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 25px;
}

/* Upload Phase layout */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.upload-box {
  background: rgba(15, 23, 42, 0.02);
  border: 2px dashed var(--panel-border);
  border-radius: var(--border-radius-lg);
  padding: 40px 30px;
  text-align: center;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.upload-box.drag-over {
  border-color: var(--accent-primary);
  background: rgba(13, 148, 136, 0.05);
}

.upload-box-icon {
  font-size: 32px;
  margin-bottom: 15px;
}

.upload-box-title {
  font-family: var(--font-outfit);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 5px;
}

.upload-box-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 200px;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.file-input-wrapper input[type="file"] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
}

.file-status {
  font-size: 12px;
  color: var(--text-muted-dark);
  margin-top: 10px;
  display: block;
}

.file-status.loaded {
  color: var(--accent-success);
  font-weight: 600;
}

.studio-footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 25px;
}

/* Mapping Phase board */
/* Mapping Phase board */
.mapping-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-lg);
  padding: 20px 25px;
  margin-bottom: 25px;
}

.mapping-board {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
  align-items: start;
}

.mapping-column {
  display: flex;
  flex-direction: column;
}

.column-title {
  font-family: var(--font-outfit);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 15px;
}

.headers-ref-list {
  list-style: none;
  background: var(--bg-darker);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-md);
  padding: 15px;
  max-height: 500px;
  overflow-y: auto;
}

.headers-ref-item {
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
  user-select: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.headers-ref-item:hover {
  background: var(--bg-darker);
  border-color: var(--panel-border-glow);
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.15);
  transform: translateY(-1px);
}

.headers-ref-item:last-child {
  margin-bottom: 0;
}

.rules-builder-list {
  background: var(--bg-darker);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.rule-builder-row {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--accent-warning); /* Amber unmapped default */
  border-radius: var(--border-radius-md);
  padding: 15px 20px;
  display: grid;
  grid-template-columns: 180px 140px 1fr;
  gap: 15px;
  align-items: center;
  transition: all var(--transition-normal);
}

.rule-builder-row:hover {
  background: var(--bg-darker);
  border-color: var(--panel-border);
}

.rule-builder-row.is-mapped {
  border-left-color: var(--accent-primary); /* Teal mapped */
  background: rgba(13, 148, 136, 0.02);
  border-color: rgba(13, 148, 136, 0.15);
}

.rule-builder-row.is-mapped:hover {
  background: rgba(13, 148, 136, 0.04);
}

.output-header-label {
  font-family: var(--font-outfit);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rule-logic-select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px !important;
  font-size: 13px !important;
  background-color: var(--panel-bg) !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: var(--border-radius-sm) !important;
  color: var(--text-main) !important;
}

.rule-details-container {
  display: flex;
  align-items: center;
  width: 100%;
}

.rule-details-container input,
.rule-details-container select {
  padding: 8px 12px !important;
  font-size: 13px !important;
  width: 100%;
  max-width: 320px; /* Constrain select and text input widths to avoid stretched layouts */
}

.concat-inputs {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 8px;
  max-width: 420px;
}

.concat-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
}

.concat-chips-container:empty {
  display: none;
}

.concat-chip {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: var(--text-main);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-fast);
}

.concat-chip:hover {
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-0.5px);
}

.concat-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  margin-left: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-weight: bold;
  transition: color var(--transition-fast);
}

.concat-chip-remove:hover {
  color: var(--accent-danger);
}

.concat-selector-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.concat-selector-row select {
  flex: 1;
  max-width: 100% !important;
}

.concat-separator-input {
  width: 90px !important;
  text-align: center;
  max-width: 90px !important;
}


/* Execution Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 6, 9, 0.85);
  backdrop-filter: blur(8px);
}

.modal-container {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-glow);
  width: 100%;
  max-width: 500px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  z-index: 101;
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
  from { transform: scale(0.9) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-outfit);
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 25px;
}

.modal-description {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.modal-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 20px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* File dropzone in modal */
.file-dropzone {
  background: rgba(0, 0, 0, 0.2);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  padding: 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition-normal);
}

.file-dropzone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.05);
}

.dropzone-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Process Mappings Summary */
.process-template-summary {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 15px;
  max-height: 140px;
  overflow-y: auto;
}

.process-template-summary h4 {
  font-family: var(--font-outfit);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.mappings-summary-list {
  list-style: none;
}

.mappings-summary-list li {
  font-size: 12.5px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  justify-content: space-between;
}

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

/* SHARING MODAL ELEMENTS */
.switch-container {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

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

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-success);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent-success);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.toggle-title {
  font-family: var(--font-outfit);
  font-size: 14px;
  font-weight: 600;
}

.toggle-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.shares-list {
  list-style: none;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 10px 15px;
  max-height: 180px;
  overflow-y: auto;
}

.shares-list li {
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.share-status-badge {
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbd38d;
}

.status-accepted {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(20, 22, 37, 0.95);
  border: 1px solid var(--accent-primary);
  border-radius: var(--border-radius-md);
  padding: 14px 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.25);
  z-index: 200;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

#toast-message {
  font-family: var(--font-outfit);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

/* Helpers */
.flex-row {
  display: flex;
  width: 100%;
}

.select-all {
  user-select: all;
}

/* Responsive adjust */
@media(max-width: 900px) {
  .sidebar-footer {
    display: none !important;
  }
  .workspace-body {
    flex-direction: column;
  }
  .workspace-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
    padding: 15px 20px;
  }
  .sidebar-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
  }
  .sidebar-title {
    margin-bottom: 0;
  }
  .sidebar-link {
    margin-bottom: 0;
    width: auto;
    display: inline-flex;
  }
  .workspace-content {
    max-height: none;
    padding: 25px 20px;
  }
  .mapping-board {
    grid-template-columns: 1fr;
  }
  .rule-builder-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   VISUAL SET FUNCTIONS AND CONDITIONAL RULES
   ========================================== */
.transform-inputs {
  display: flex;
  gap: 10px;
  width: 100%;
}

.transform-inputs select {
  flex: 1;
}

.conditional-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  background: rgba(0, 0, 0, 0.35); /* Darker panel background */
  padding: 18px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--accent-secondary); /* Distinct left accent line (Indigo) */
  max-width: 600px;
}

.cond-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.cond-label {
  font-family: var(--font-outfit);
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-primary-hover);
  width: 60px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cond-row select,
.cond-row input {
  padding: 6px 10px !important;
  font-size: 12px !important;
  max-width: 100% !important; /* Overrides default 320px constraint inside flex rows */
}

.cond-field-select {
  flex: 2;
}

.cond-operator-select {
  width: 160px;
  flex: 1;
}

.cond-threshold-input {
  width: 130px;
  flex: 1;
}

.cond-true-val-container,
.cond-false-val-container {
  display: flex;
  align-items: center;
  flex: 2;
  gap: 8px;
}

.cond-true-value-el,
.cond-false-value-el {
  flex: 1;
}

/* ==========================================
   BILLING AND SUBSCRIPTIONS PRICING UI
   ========================================== */
.billing-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px 25px;
  border-radius: var(--border-radius-md);
  margin-bottom: 25px;
}

.status-left {
  display: flex;
  flex-direction: column;
}

.status-plan-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-label {
  font-family: var(--font-outfit);
  font-weight: 600;
  color: var(--text-muted);
}

.plan-badge {
  font-family: var(--font-outfit);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.free-badge {
  background: rgba(156, 163, 175, 0.15);
  border: 1px solid rgba(156, 163, 175, 0.3);
  color: #d1d5db;
}

.basic-badge {
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid rgba(100, 116, 139, 0.25);
  color: var(--text-muted);
}

.premium-badge {
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.25);
  color: var(--accent-primary);
}

.status-plan-usage {
  font-size: 14px;
  color: var(--text-muted);
}

.status-plan-usage strong {
  color: var(--text-main);
  font-size: 16px;
}

.upgrade-banner {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-left: 4px solid var(--accent-warning);
  padding: 15px 20px;
  border-radius: var(--border-radius-md);
  margin-bottom: 25px;
}

.banner-icon {
  font-size: 20px;
  line-height: 1.2;
}

.banner-content h4 {
  font-family: var(--font-outfit);
  color: var(--accent-warning);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
}

.banner-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.banner-content a {
  color: var(--accent-primary-hover);
  text-decoration: underline;
  font-weight: 600;
}

.banner-content a:hover {
  color: var(--accent-primary-hover);
}

.pricing-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 30px 0 20px 0;
  color: var(--text-muted-dark);
  font-family: var(--font-outfit);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.pricing-divider::before,
.pricing-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed var(--panel-border);
}

.pricing-divider:not(:empty)::before {
  margin-right: 15px;
}

.pricing-divider:not(:empty)::after {
  margin-left: 15px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  align-items: stretch;
}

.pricing-card {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-lg);
  padding: 30px 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
}

.pricing-card:hover {
  background: var(--panel-bg);
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.pricing-card.premium-border {
  border-color: rgba(13, 148, 136, 0.4);
  background: rgba(13, 148, 136, 0.02);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.06);
}

.pricing-card.premium-border:hover {
  border-color: rgba(13, 148, 136, 0.7);
  background: rgba(13, 148, 136, 0.04);
  box-shadow: 0 10px 30px rgba(13, 148, 136, 0.12);
}

.pricing-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
  color: #fff;
  font-family: var(--font-outfit);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.25);
}

.pricing-card-badge-current {
  background: var(--bg-darker);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
}

.pricing-card-header {
  margin-bottom: 25px;
}

.pricing-title {
  font-family: var(--font-outfit);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.pricing-price {
  font-family: var(--font-outfit);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 15px;
}

.pricing-period {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pricing-features {
  margin-bottom: 30px;
}

.pricing-features ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-features li {
  font-size: 13.5px;
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pricing-features li span {
  color: var(--accent-success);
  font-weight: bold;
}

.pricing-actions {
  width: 100%;
}

/* ==========================================
   ONBOARDING & TUTORIAL SYSTEM
   ========================================== */

.onboarding-guide {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(20, 184, 166, 0.04) 100%);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 12px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.05), inset 0 0 12px rgba(255, 255, 255, 0.01);
}

.onboarding-guide:hover {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12) 0%, rgba(20, 184, 166, 0.06) 100%);
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 6px 25px rgba(13, 148, 136, 0.12);
  transform: translateY(-2px) scale(1.005);
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guide-icon {
  font-size: 24px;
  animation: pulse 2.5s infinite ease-in-out;
  display: inline-block;
}

.guide-content h4 {
  margin: 0 0 4px 0;
  color: var(--accent-primary);
  font-size: 15px;
  font-family: var(--font-outfit);
  font-weight: 600;
}

.guide-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Dashboard Onboarding Steps */
.onboarding-steps-container {
  padding: 48px 32px;
  text-align: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.04);
}

.onboarding-steps-container h3 {
  font-size: 22px;
  font-family: var(--font-outfit);
  margin-bottom: 32px;
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.onboarding-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.onboarding-step-card {
  background: var(--bg-darker);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-step-card:hover {
  background: var(--panel-bg);
  transform: translateY(-4px);
  border-color: var(--panel-border-glow);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.15);
}

.onboarding-step-card h4 {
  font-family: var(--font-outfit);
  font-size: 16px;
  margin: 0 0 10px 0;
  color: var(--text-main);
  font-weight: 600;
}

.onboarding-step-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Developer API Keys Management Card styling */
.api-keys-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 24px;
}

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

.api-keys-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-keys-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-darker);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.key-info h5 {
  margin: 0 0 4px 0;
  font-family: var(--font-outfit);
  font-size: 14px;
  color: var(--text-main);
  font-weight: 600;
}

.key-info p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* API Docs Code Block & Tabs Styling */
.code-docs-container {
  border-top: 1px solid var(--panel-border);
  padding-top: 20px;
}

.docs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.docs-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-outfit);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.docs-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.docs-tab-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  font-weight: 600;
}

.code-block {
  background: #0f172a !important;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
}

/* Custom Select Dropdowns */
.custom-select-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  display: inline-block;
  font-family: var(--font-body);
  z-index: 2;
}

.custom-select-wrapper.open {
  z-index: 9999 !important;
}

.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--accent-primary);
  background: var(--bg-darker);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}

.custom-select-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.custom-select-arrow {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.custom-select-wrapper:focus-within .custom-select-trigger {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.custom-select-menu {
  /* Popover API — renders in browser top layer: above ALL z-index, GPU compositing layers, stacking contexts */
  position: fixed !important;  /* Viewport-relative within the top layer */
  z-index: 999999 !important;
  inset: unset;     /* Override browser default popover centering (inset:0 + margin:auto) */
  margin: 0;
  min-width: 220px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(13, 148, 136, 0.05);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
}

/* .hidden class no longer used — popover API manages display via top-layer show/hide */

.custom-select-search {
  background: var(--bg-darker);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  outline: none;
  width: 100%;
  transition: all 0.2s ease;
}

.custom-select-search:focus {
  border-color: var(--accent-primary);
  background: var(--panel-bg);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

.custom-select-options {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  max-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.custom-select-option-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-main) !important; /* Force light text color to avoid dark/black inheritance issues */
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-option-item:hover {
  background: rgba(13, 148, 136, 0.08) !important;
  color: var(--accent-primary) !important;
  padding-left: 14px;
}

.custom-select-option-item.selected {
  background: rgba(13, 148, 136, 0.15) !important;
  color: var(--accent-primary) !important;
  font-weight: 600;
  border-left: 2px solid var(--accent-primary);
}

/* Scrollbar styling for custom dropdown list */
.custom-select-options::-webkit-scrollbar {
  width: 6px;
}
.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}
.custom-select-options::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 3px;
}
.custom-select-options::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Strip native select arrows and add custom SVG indicators for other select menus */
.rule-logic-select,
.rule-transform-type-select,
.cond-operator-select,
.cond-true-source-select,
.cond-false-source-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='currentColor' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  padding-right: 28px !important;
}

.upload-box:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.015);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* ==========================================
   TEAM MANAGEMENT STYLES
   ========================================== */

.team-members-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.team-member-card:hover {
  border-color: var(--panel-border-glow);
  background: var(--bg-darker);
}

.team-member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.team-member-email {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

.team-member-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.team-member-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-owner-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.25);
  color: var(--accent-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-you-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-success);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-pending-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent-warning);
  letter-spacing: 0.04em;
}

.team-remove-btn {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: var(--font-outfit);
}

.team-remove-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
}

.team-cancel-invite-btn {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-outfit);
}

.team-cancel-invite-btn:hover {
  background: rgba(100, 116, 139, 0.2);
}

.team-member-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 0;
}

/* Seat usage progress bar */
.team-seat-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-darker);
  border-radius: 99px;
  overflow: hidden;
}

.team-seat-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.5s ease;
}

.team-seat-bar-fill.warn {
  background: linear-gradient(90deg, var(--accent-warning), #fbbf24);
}

.team-seat-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* API access toggle button (owner view) */
.team-api-toggle-btn {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: var(--font-outfit);
  font-weight: 500;
  white-space: nowrap;
}

.team-api-toggle-btn.api-off {
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid rgba(100, 116, 139, 0.2);
  color: #64748b;
}

.team-api-toggle-btn.api-off:hover {
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.25);
  color: var(--accent-primary);
}

.team-api-toggle-btn.api-on {
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.35);
  color: var(--accent-primary);
}

.team-api-toggle-btn.api-on:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* API access granted status chip (member's own view) */
.team-api-granted-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(13, 148, 136, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.3);
  color: var(--accent-primary);
  letter-spacing: 0.04em;
}
