/* ============================================
   REGENESIS FEATURE BUILDER — STYLES
   ============================================ */

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Sidebar */
  --sidebar-bg: #0d121a;
  --sidebar-w: 228px;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active: #ac843e; /* Gold active style */
  --sidebar-text: #8e9cae;
  --sidebar-heading: #52637a;

  /* Main */
  --main-bg: #f3f6fa;
  --card-bg: #ffffff;
  --text-primary: #17202c;
  --text-secondary: #4a5c6e;
  --text-muted: #8ca3ba;
  --border: #d4e0eb;

  /* Accents */
  --pod-primary: #5b7a8c;
  --pod-gradient: linear-gradient(135deg, #1f2a35 0%, #3a4f61 50%, #293946 100%);
  --pod-dot: #5b7a8c;

  --phone-primary: #ac843e;
  --phone-gradient: linear-gradient(135deg, #4f3b1b 0%, #906e33 50%, #6d5325 100%);
  --phone-dot: #ac843e;

  --global-primary: #4e657a;
  --global-gradient: linear-gradient(135deg, #151f2b 0%, #2e4154 50%, #1f2d3b 100%);
  --global-dot: #4e657a;

  /* Misc */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--main-bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- LAYOUT ---------- */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-header {
  padding: 20px 18px 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.logo-text {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1.5px;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 0 10px;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-heading);
  letter-spacing: 1.2px;
  padding: 14px 10px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  text-align: left;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item .nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-item .nav-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-item .nav-title {
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item .nav-subtitle {
  font-size: 10.5px;
  opacity: 0.65;
  font-weight: 400;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--transition);
  text-align: left;
  margin-bottom: 1px;
}

.tool-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.tool-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* System Status */
.system-status {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

.system-status .status-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-heading);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e88;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 4px #22c55e66; }
  50% { box-shadow: 0 0 10px #22c55eaa; }
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 6px #ef444488;
  animation: pulse-dot-offline 2s infinite;
}

@keyframes pulse-dot-offline {
  0%, 100% { box-shadow: 0 0 4px #ef444466; }
  50% { box-shadow: 0 0 10px #ef4444aa; }
}

.status-text {
  font-size: 12px;
  color: var(--sidebar-text);
  font-weight: 500;
}

.status-time {
  display: block;
  font-size: 10.5px;
  color: var(--sidebar-heading);
  margin-top: 3px;
  padding-left: 15px;
}

/* ---------- MAIN AREA ---------- */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

/* Header */
.main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 28px 14px;
  flex-shrink: 0;
}

.header-text h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.header-text p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.view-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.view-toggle {
  display: flex;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.toggle-btn {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  border-radius: 0;
}

.toggle-btn.active {
  background: var(--sidebar-bg);
  color: #ffffff;
}

.toggle-btn:hover:not(.active) {
  background: #f1f5f9;
}

/* ---------- CARDS CONTAINER ---------- */
.cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 8px 28px 20px;
  flex: 1;
  align-content: start;
}

/* ---------- APP CARD ---------- */
.app-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeInUp 0.5s ease both;
}

.app-card:nth-child(1) { animation-delay: 0.05s; }
.app-card:nth-child(2) { animation-delay: 0.15s; }
.app-card:nth-child(3) { animation-delay: 0.25s; }

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

.app-card:hover {
  box-shadow: var(--shadow-lg);
}

.app-card.highlight {
  box-shadow: 0 0 0 2px var(--sidebar-active), var(--shadow-lg);
}

/* Card Header */
.card-header {
  position: relative;
  padding: 16px 18px 14px;
  color: #ffffff;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-header.pod {
  background-image: url('Reference/Brand Pack/podapp banner.png');
  background-size: cover;
  background-position: center;
}
.card-header.phone {
  background-image: url('Reference/Brand Pack/Mobile app banner.png');
  background-size: cover;
  background-position: center;
}
.card-header.global {
  background-image: url('Reference/Brand Pack/Global app banner.png');
  background-size: cover;
  background-position: center;
}

.card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13, 18, 26, 0.45) 0%, rgba(13, 18, 26, 0.2) 50%, rgba(13, 18, 26, 0.6) 100%);
  pointer-events: none;
  z-index: 0;
}

.card-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.card-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.card-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-name {
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.card-type {
  font-size: 11.5px;
  opacity: 0.85;
  font-weight: 400;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Card Mockup */
.card-mockup {
  display: none;
}

.mockup-phone {
  width: 120px;
  height: 155px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.mockup-phone .phone-status {
  background: #1e293b;
  padding: 4px 8px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7px;
  color: #ffffff;
  font-weight: 600;
}

.mockup-phone .phone-body {
  flex: 1;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  font-size: 7px;
  color: #1e293b;
  overflow: hidden;
}

/* Pod mockup specific */
.phone-body.pod-screen {
  align-items: center;
  text-align: center;
  background: #f8fafc;
}

.phone-body.pod-screen .pod-label {
  font-size: 5.5px;
  color: #94a3b8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.phone-body.pod-screen .pod-welcome {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.phone-body.pod-screen .pod-subtitle {
  font-size: 6px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.phone-body.pod-screen .pod-actions {
  display: flex;
  gap: 4px;
  width: 100%;
}

.phone-body.pod-screen .pod-action {
  flex: 1;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 6px 2px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.phone-body.pod-screen .pod-action-icon {
  width: 18px;
  height: 18px;
  background: #e2e8f0;
  border-radius: 4px;
}

.phone-body.pod-screen .pod-action-label {
  font-size: 5px;
  color: #64748b;
  font-weight: 500;
}

/* Phone app mockup */
.phone-body.user-screen {
  background: #f8fafc;
}

.phone-body.user-screen .user-greeting {
  font-size: 6px;
  color: #94a3b8;
  margin-bottom: 1px;
}

.phone-body.user-screen .user-name {
  font-size: 10px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.phone-body.user-screen .user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--phone-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  margin-bottom: 4px;
}

.phone-body.user-screen .health-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.phone-body.user-screen .health-label {
  font-size: 6px;
  color: #64748b;
}

.phone-body.user-screen .health-badge {
  font-size: 5.5px;
  font-weight: 600;
  color: #22c55e;
  background: #f0fdf4;
  padding: 1px 4px;
  border-radius: 3px;
}

.phone-body.user-screen .membership-item {
  background: #ffffff;
  border-radius: 4px;
  padding: 4px 6px;
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 6px;
  border: 1px solid #f1f5f9;
}

.phone-body.user-screen .membership-badge {
  font-size: 5px;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 600;
}

.phone-body.user-screen .membership-badge.active {
  color: #22c55e;
  background: #f0fdf4;
}

/* Global app mockup */
.mockup-dashboard {
  width: 165px;
  height: 125px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
}

.mockup-dashboard .dash-sidebar {
  width: 36px;
  background: #1e293b;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mockup-dashboard .dash-nav-item {
  width: 100%;
  height: 6px;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
}

.mockup-dashboard .dash-nav-item.active {
  background: rgba(255,255,255,0.3);
}

.mockup-dashboard .dash-main {
  flex: 1;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.mockup-dashboard .dash-title {
  font-size: 7px;
  font-weight: 700;
  color: #1e293b;
}

.mockup-dashboard .dash-stats {
  display: flex;
  gap: 4px;
}

.mockup-dashboard .dash-stat {
  flex: 1;
  background: #f8fafc;
  border-radius: 3px;
  padding: 3px 4px;
  text-align: center;
}

.mockup-dashboard .dash-stat-label {
  font-size: 4px;
  color: #94a3b8;
}

.mockup-dashboard .dash-stat-value {
  font-size: 7px;
  font-weight: 700;
  color: #1e293b;
}

.mockup-dashboard .dash-stat-change {
  font-size: 4px;
  color: #22c55e;
}

.mockup-dashboard .dash-charts {
  display: flex;
  gap: 4px;
  flex: 1;
}

.mockup-dashboard .dash-chart {
  flex: 1;
  background: #f8fafc;
  border-radius: 3px;
  padding: 3px;
}

.mockup-dashboard .dash-chart-title {
  font-size: 4.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}

/* ---------- CARD BODY ---------- */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4px 0 0;
}

.features-list {
  flex: 1;
  padding: 0;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.feature-item:hover {
  background: #f8fafc;
}

.feature-item:hover .feature-delete {
  opacity: 1;
}

.feature-item:hover .feature-arrow {
  opacity: 1;
  transform: translateX(0);
}

.dev-status-badge {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  display: inline-block;
  white-space: nowrap;
}

.dev-status-badge.planned {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.dev-status-badge.planned:hover {
  background: #e2e8f0;
  transform: translateY(-0.5px);
}

.dev-status-badge.in-progress {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.dev-status-badge.in-progress:hover {
  background: #fef3c7;
  transform: translateY(-0.5px);
}

.dev-status-badge.developed {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.dev-status-badge.developed:hover {
  background: #dcfce7;
  transform: translateY(-0.5px);
}

.dev-status-badge.removed {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.dev-status-badge.removed:hover {
  background: #fee2e2;
  transform: translateY(-0.5px);
}

.inline-status-select {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 16px 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  height: 18px;
  outline: none;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 7px;
  display: inline-block;
  transition: all var(--transition);
}

.inline-status-select.planned {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.inline-status-select.in-progress {
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.inline-status-select.developed {
  background-color: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.inline-status-select.removed {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}


.feature-content {
  flex: 1;
  min-width: 0;
}

.feature-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 1px;
}

.feature-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.feature-arrow {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition);
}

.feature-delete {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #ef4444;
  background: #fef2f2;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 2;
}

.feature-delete:hover {
  background: #fee2e2;
}

/* Feature Details (visible in Details mode) */
.feature-details {
  display: none;
  padding: 8px 0 4px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px dashed var(--border);
  margin-top: 6px;
}

.feature-details .detail-section {
  margin-bottom: 6px;
}

.feature-details .detail-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.details-mode .feature-details {
  display: block;
}

/* Inline Editing */
.feature-title.editing,
.feature-desc.editing {
  outline: none;
  background: #eff6ff;
  border-radius: 3px;
  padding: 1px 4px;
  border: 1px solid var(--sidebar-active);
}

/* Card Footer */
.card-footer {
  padding: 10px 16px 14px;
  display: flex;
  gap: 8px;
}

.view-flows-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
}

.view-flows-btn.pod {
  background: #f0f4f8;
  color: var(--pod-primary);
  border: 1px solid #d4e0eb;
}
.view-flows-btn.pod:hover { background: #e2ecf5; }

.view-flows-btn.phone {
  background: #fbf8f3;
  color: var(--phone-primary);
  border: 1px solid #f2e7d5;
}
.view-flows-btn.phone:hover { background: #f5edd9; }

.view-flows-btn.global {
  background: #f1f4f9;
  color: var(--global-primary);
  border: 1px solid #d9e2ec;
}
.view-flows-btn.global:hover { background: #e1e7f0; }

.view-flows-btn svg {
  width: 14px;
  height: 14px;
}

.add-feature-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: all var(--transition);
}

.add-feature-btn:hover {
  background: #f1f5f9;
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

/* ---------- BOTTOM BAR ---------- */
.bottom-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 28px 10px;
  flex-shrink: 0;
}

.bottom-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.info-icon-wrap {
  flex-shrink: 0;
  margin-top: 1px;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-content strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.info-content span {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.bottom-links {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.bottom-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  text-align: left;
}

.bottom-link:hover {
  background: #f1f5f9;
}

.bottom-link svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.bottom-link div {
  display: flex;
  flex-direction: column;
}

.bottom-link strong {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.bottom-link span {
  font-size: 9.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.footer-copy {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 0 12px;
  flex-shrink: 0;
}

/* ---------- MODALS ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 620px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  transition: all var(--transition);
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.modal-tabs {
  display: flex;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
}

.modal-tab {
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.modal-tab:hover {
  color: var(--text-primary);
}

.modal-tab.active {
  color: var(--sidebar-active);
  border-bottom-color: var(--sidebar-active);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
  padding: 8px 18px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--sidebar-active);
  color: #ffffff;
}

.btn-primary:hover {
  background: #2b5ce5;
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-header-action {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-header-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.btn-header-action:active {
  transform: translateY(0);
}

/* Modal Tab Content */
.tab-panel {
  display: none;
}

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

.tab-panel textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.tab-panel textarea:focus {
  outline: none;
  border-color: var(--sidebar-active);
  box-shadow: 0 0 0 3px rgba(59,108,245,0.1);
}

.tab-panel .field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

/* Flow Steps */
.flow-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.flow-step {
  display: flex;
  gap: 12px;
  position: relative;
  padding: 10px 0;
}

.flow-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: -2px;
  width: 2px;
  background: var(--border);
}

.flow-step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--sidebar-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 1;
}

.flow-step-content {
  flex: 1;
}

.flow-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.flow-step-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Permissions Table */
.permissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.permissions-table th {
  text-align: left;
  padding: 8px 10px;
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  font-size: 11.5px;
}

.permissions-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
}

.permissions-table tr:hover td {
  background: #fafbfd;
}

.perm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}

.perm-badge.full { background: #dcfce7; color: #15803d; }
.perm-badge.execute { background: #dbeafe; color: #1d4ed8; }
.perm-badge.read { background: #f1f5f9; color: #475569; }
.perm-badge.none { background: #fef2f2; color: #dc2626; }

/* Flow Modal */
.flow-modal {
  max-width: 680px;
}

.flow-modal-body {
  padding: 0 !important;
}

.flow-app-section {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.flow-app-section:last-child {
  border-bottom: none;
}

.flow-app-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-app-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Add Feature Form */
.add-feature-form {
  padding: 18px 22px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--sidebar-active);
  box-shadow: 0 0 0 3px rgba(59,108,245,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* Tool Modal */
.tool-modal {
  max-width: 720px;
}

.tool-content-section {
  margin-bottom: 18px;
}

.tool-content-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.tool-content-section p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.tool-content-section ul {
  padding-left: 18px;
  margin-bottom: 8px;
}

.tool-content-section li {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ---------- TOAST ---------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--sidebar-bg);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success::before {
  content: '✓';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.toast.error::before {
  content: '✕';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 60px;
    min-width: 60px;
  }
  .logo-text,
  .nav-subtitle,
  .nav-label,
  .tool-item span,
  .status-text,
  .status-time,
  .system-status .status-label {
    display: none;
  }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .nav-icon { margin: 0; }
  .tool-item { justify-content: center; padding: 10px; }
  .sidebar-header { padding: 16px 10px; justify-content: center; }
  .logo { justify-content: center; }
  .cards-container { grid-template-columns: 1fr; padding: 8px 16px 20px; }
  .main-header { padding: 16px; flex-direction: column; gap: 10px; }
  .bottom-bar { flex-direction: column; margin: 0 16px 10px; }
  .bottom-links { flex-wrap: wrap; }
}

/* ============================================
   NEW EDITABLE COMPONENTS & BRAND STYLES
   ============================================ */

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel-header-row .field-label {
  margin-bottom: 0;
}

.add-row-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #f0f4f8;
  color: var(--sidebar-active);
  border: 1px solid #d4e0eb;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  transition: all var(--transition);
}

.add-row-btn:hover {
  background: #e2ecf5;
  transform: translateY(-1px);
}

.add-row-btn svg {
  stroke-width: 2.5px;
}

.remove-row-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  transition: all var(--transition);
  flex-shrink: 0;
}

.remove-row-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  transform: scale(1.05);
}

/* Lists and Lists containers */
.editable-flow-list, .editable-entity-list, .editable-perm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

/* User flows editable rows */
.editable-step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: border-color var(--transition);
}

.editable-step-row:hover {
  border-color: #cbd5e1;
}

.step-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-title-input {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  outline: none;
  font-family: inherit;
}

.step-title-input:focus {
  border-color: var(--sidebar-active);
}

.step-desc-input {
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}

.step-desc-input:focus {
  border-color: var(--sidebar-active);
}

/* Data model editable rows */
.editable-entity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.entity-inputs {
  flex: 1;
  display: flex;
  gap: 10px;
}

.entity-name-input {
  flex: 1;
  font-weight: 600;
  font-size: 12.5px;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  outline: none;
  font-family: inherit;
}

.entity-name-input:focus {
  border-color: var(--sidebar-active);
}

.entity-fields-input {
  flex: 1.5;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  outline: none;
  font-family: inherit;
}

.entity-fields-input:focus {
  border-color: var(--sidebar-active);
}

/* Permissions editable rows */
.editable-perm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.perm-inputs {
  flex: 1;
  display: flex;
  gap: 10px;
}

.perm-role-input {
  flex: 1;
  font-weight: 600;
  font-size: 12.5px;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  outline: none;
  font-family: inherit;
}

.perm-role-input:focus {
  border-color: var(--sidebar-active);
}

.perm-level-input {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  outline: none;
  font-family: inherit;
}

.perm-level-input:focus {
  border-color: var(--sidebar-active);
}

/* Modal Status Selector Badge */
.modal-status-select {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 20px 3px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
  margin-left: 12px;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px;
}

.modal-status-select.planned {
  background-color: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

.modal-status-select.in-progress {
  background-color: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}

.modal-status-select.developed {
  background-color: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.modal-status-select.removed {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.formatted-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Screenshots tab & Upload/Delete styling */
.screenshots-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.screenshots-gallery-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.screenshot-item-wrap {
  position: relative;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-hover);
}

.screenshot-item-wrap img {
  display: block;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.screenshots-gallery .screenshot-item-wrap img:hover {
  transform: scale(1.02);
}

.btn-delete-screenshot {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-delete-screenshot:hover {
  background: rgba(220, 38, 38, 1);
  transform: scale(1.1);
}

.upload-section {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xs);
  padding: 24px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.upload-section:hover {
  border-color: var(--sidebar-active);
  background-color: #f8fafc;
}

