:root {
  --bg-main: #0b0f17;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.85);
  --bg-glass: rgba(14, 20, 33, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(16, 185, 129, 0.3);
  
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.25);
  
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(139, 92, 246, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== HEADER ==================== */
.app-header {
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0f17;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.brand-logo svg {
  width: 24px;
  height: 24px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.vps-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(18, 24, 38, 0.9);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-indicator.online {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.status-indicator.offline {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

.status-indicator.pinging {
  background: #f59e0b;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn svg {
  width: 15px;
  height: 15px;
  opacity: 0.7;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.tab-btn.active svg {
  opacity: 1;
  stroke: var(--primary);
}

/* ==================== MAIN CONTAINER ==================== */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* ==================== HERO CARD ==================== */
.hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(15, 23, 42, 0.8) 50%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.badge-pill {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

.hero-content h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  background: linear-gradient(to right, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: var(--text-muted);
  max-width: 820px;
  font-size: 0.98rem;
  margin-bottom: 2rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.75rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ==================== PANELS & GRIDS ==================== */
.dashboard-grid,
.apikeys-grid,
.mcp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.75rem;
}

.flex-2 {
  grid-column: span 1;
}

@media (min-width: 1024px) {
  .apikeys-grid,
  .mcp-grid {
    grid-template-columns: 380px 1fr;
  }
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.panel-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #f8fafc;
}

.card-header h3 svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.card-body {
  padding: 1.5rem;
}

.tag-status {
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
}

.tag-badge {
  font-size: 0.75rem;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-group textarea {
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(15, 23, 42, 0.9);
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
}

.helper-text {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #0b0f17;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.w-100 {
  width: 100%;
}

/* ==================== API KEYS STYLES ==================== */
.keys-table-container {
  max-height: 400px;
  overflow-y: auto;
}

.keys-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.key-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.key-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(15, 23, 42, 0.8);
}

.key-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.key-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

.key-app-tag {
  font-size: 0.72rem;
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-weight: 500;
}

.key-secret-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  background: #080c14;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.key-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.key-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-revoke {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-revoke:hover {
  background: rgba(239, 68, 68, 0.25);
}

.key-usage-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(16, 185, 129, 0.05);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.key-usage-info svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.key-usage-info code {
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ==================== HOW TO APPLY STYLES ==================== */
.apply-guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.75rem;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.guide-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  align-self: flex-start;
  margin-bottom: 1rem;
}

.badge-whatsapp { background: rgba(37, 211, 102, 0.15); color: #25d366; border: 1px solid rgba(37, 211, 102, 0.3); }
.badge-web { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-mobile { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-backend { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.guide-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.guide-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.whatsapp-bg { background: rgba(37, 211, 102, 0.15); color: #25d366; }
.web-bg { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.mobile-bg { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.backend-bg { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.guide-icon-box svg {
  width: 22px;
  height: 22px;
}

.guide-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.guide-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.guide-steps {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guide-steps strong {
  color: #ffffff;
}

.guide-steps ul {
  padding-left: 1.25rem;
  margin-top: 0.35rem;
  color: var(--text-dim);
}

.mini-code {
  background: #06090f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #38bdf8;
  overflow-x: auto;
  line-height: 1.5;
}

.active-key-span {
  color: #34d399;
  font-weight: 600;
}

/* ==================== MCP STYLES ==================== */
.mcp-tools-list {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.mcp-tools-list h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.85rem;
}

.mcp-tool-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.tool-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}

.tool-desc {
  color: var(--text-muted);
}

.mt-1 { margin-top: 1rem; }
.text-dim-sm { font-size: 0.85rem; color: var(--text-muted); }

/* ==================== CODE BOX & GENERATOR ==================== */
.section-intro {
  margin-bottom: 2rem;
}

.section-intro h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-intro p {
  color: var(--text-muted);
  max-width: 800px;
}

.generator-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
  min-width: 220px;
}

.code-box-wrapper {
  background: #06090e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.7);
  margin-bottom: 2rem;
}

.code-header {
  background: rgba(18, 24, 38, 0.95);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.code-dot.red { background: #ef4444; }
.code-dot.yellow { background: #f59e0b; }
.code-dot.green { background: #10b981; }

.btn-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-copy.copied {
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary);
  border-color: rgba(16, 185, 129, 0.5);
}

.code-content {
  padding: 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* ==================== SERVICES LIST ==================== */
.service-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.service-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.service-icon svg {
  width: 20px;
  height: 20px;
}

.service-details {
  flex: 1;
}

.service-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
  font-family: var(--font-mono);
}

.service-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.badge-success {
  font-size: 0.72rem;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
}

.badge-primary {
  font-size: 0.72rem;
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
}

.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.alert-box svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.alert-box strong {
  color: #ffffff;
}

/* ==================== MODELS TAB ==================== */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.model-card:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.3);
}

.model-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.model-card-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0.35rem;
}

.model-author {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.model-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  display: inline-block;
}

.tag-speed { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.tag-code { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.tag-reasoning { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.tag-general { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.tag-vision { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.tag-rag { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.tag-image { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.tag-chat { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }

.model-ram-badge {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.model-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.model-specs {
  display: flex;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.model-specs strong {
  color: var(--text-main);
}

.install-box {
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.install-box code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-box .highlight {
  color: var(--primary);
}

.btn-copy-sm {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-copy-sm:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-copy-sm.copied {
  background: var(--primary);
  color: #0b0f17;
}

/* Batch install panel */
.batch-install-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(18, 24, 38, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.batch-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.batch-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.code-terminal {
  background: #05080f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #34d399;
}

/* ==================== PROMPTS TAB ==================== */
.prompts-accordion {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.prompt-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.prompt-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.prompt-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.badge-role {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.prompt-title h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-copy-prompt {
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-prompt:hover {
  background: var(--primary);
  color: #0b0f17;
}

.btn-copy-prompt.copied {
  background: #34d399;
  color: #0b0f17;
}

.prompt-body {
  padding: 1.5rem;
}

.prompt-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.prompt-body textarea {
  width: 100%;
  background: #070b12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
}

/* ==================== PLAYGROUND TAB ==================== */
.playground-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

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

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
}

.chat-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 580px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.chat-agent-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
}

.chat-agent-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-agent-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  gap: 0.85rem;
  max-width: 85%;
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.message.assistant .msg-avatar {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #0b0f17;
}

.message.user .msg-avatar {
  background: #3b82f6;
  color: #ffffff;
}

.msg-content {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}

.message.user .msg-content {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #ffffff;
}

.chat-input-bar {
  padding: 1rem 1.5rem;
  background: rgba(18, 24, 38, 0.95);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-input-bar textarea {
  flex: 1;
  background: rgba(11, 15, 23, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
}

.chat-input-bar textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==================== EASYPANEL TAB ==================== */
.easypanel-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  gap: 1.5rem;
  box-shadow: var(--shadow-card);
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.env-table {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.env-row {
  display: grid;
  grid-template-columns: 200px 100px 1fr;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  align-items: center;
}

.env-row:last-child {
  border-bottom: none;
}

.env-key {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #38bdf8;
}

.env-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #34d399;
}

.env-desc {
  color: var(--text-muted);
}

/* ==================== FOOTER ==================== */
.app-footer {
  border-top: 1px solid var(--border-color);
  background: rgba(11, 15, 23, 0.9);
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-note {
  color: var(--text-muted);
  font-weight: 500;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-tabs {
    width: 100%;
  }
  
  .dashboard-grid,
  .apikeys-grid,
  .apply-guides-grid,
  .mcp-grid,
  .models-grid {
    grid-template-columns: 1fr;
  }
  
  .step-card {
    flex-direction: column;
  }
  
  .env-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* ==================== USER PROFILE BADGE ==================== */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-avatar-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-email-text {
  color: #e2e8f0;
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.5);
}

/* ==================== AUTH OVERLAY / LOGIN ==================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 29, 0.92);
  backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 50px rgba(16, 185, 129, 0.15);
  text-align: center;
  overflow: hidden;
}

.auth-card-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(6, 182, 212, 0.15) 60%, transparent 100%);
  filter: blur(35px);
  pointer-events: none;
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.auth-logo svg {
  width: 32px;
  height: 32px;
  color: #ffffff;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.auth-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 1.75rem;
}

.auth-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-icon input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.btn-auth-submit {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: var(--radius-md);
}

.btn-auth-submit svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.auth-footer {
  margin-top: 1.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ==================== TAB ARQUITETO ANTIGRAVITY ==================== */

.btn-tab-antigravity {
  position: relative;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.btn-tab-antigravity:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.tab-badge-glow {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #0b0f17;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 0.3rem;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
  animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.antigravity-intro {
  margin-bottom: 1.5rem;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* WORKSPACE LAYOUT (3 COLUNAS) */
.antigravity-workspace {
  display: grid;
  grid-template-columns: 290px 1fr 380px;
  gap: 1.25rem;
  min-height: 720px;
  max-height: calc(100vh - 180px);
  position: relative;
}

@media (max-width: 1300px) {
  .antigravity-workspace {
    grid-template-columns: 260px 1fr 320px;
  }
}

@media (max-width: 1080px) {
  .antigravity-workspace {
    grid-template-columns: 260px 1fr;
    max-height: none;
  }
  .antigravity-prompt-panel {
    display: none;
    position: fixed;
    top: 70px;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    z-index: 150;
    box-shadow: -10px 0 30px rgba(0,0,0,0.8);
  }
  .antigravity-prompt-panel.mobile-open {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .antigravity-workspace {
    grid-template-columns: 1fr;
  }
  .antigravity-sidebar {
    max-height: 280px;
  }
}

/* SIDEBAR DE SESSÕES */
.antigravity-sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow: hidden;
}

.btn-new-session {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #059669 0%, #0891b2 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-new-session:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
  opacity: 0.95;
}

.session-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.session-search-box svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
}

.session-search-box input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.2rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}

.session-search-box input:focus {
  border-color: var(--accent-cyan);
}

.sessions-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.25rem;
  min-height: 180px;
}

.session-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.session-item:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.session-item.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.15) 100%);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.session-item-body {
  flex: 1;
  min-width: 0;
}

.session-item-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

.session-item.active .session-item-title {
  color: #38bdf8;
}

.session-item-snippet {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.session-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.session-badge-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.65rem;
}

.session-actions {
  display: flex;
  gap: 0.2rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.session-item:hover .session-actions,
.session-item.active .session-actions {
  opacity: 1;
}

.btn-icon-session {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-session:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon-session.btn-delete-session:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

/* PROMPT MEMORY CARD */
.project-memory-card {
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.8rem;
}

.memory-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.memory-card-header h4 {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.memory-count-badge {
  font-size: 0.68rem;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-weight: 700;
}

.memory-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 85px;
  overflow-y: auto;
  margin-bottom: 0.6rem;
}

.memory-tag {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.memory-tag.highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.memory-tag.empty {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.72rem;
  background: transparent;
  border: none;
  padding: 0;
}

.memory-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.45rem;
}

/* ÁREA DE CHAT & ENTREVISTA */
.antigravity-chat-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-top-bar {
  padding: 0.85rem 1.25rem;
  background: rgba(11, 15, 23, 0.7);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.chat-project-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-project-icon {
  font-size: 1.1rem;
}

.chat-project-title-wrap h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.btn-rename-session {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
}

.btn-rename-session:hover {
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.1);
}

.chat-meta-tags {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.meta-pill {
  font-size: 0.68rem;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

.meta-pill-outline {
  font-size: 0.68rem;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
}

.meta-pill-memory {
  font-size: 0.68rem;
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select-sm-dark {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  outline: none;
}

.btn-sm-action {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sm-action:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: #38bdf8;
}

.btn-sm-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.btn-sm-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* CONTAINER DE MENSAGENS */
.antigravity-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ag-msg {
  display: flex;
  gap: 0.85rem;
  max-width: 90%;
  animation: fadeIn 0.2s ease;
}

.ag-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ag-msg.assistant {
  align-self: flex-start;
}

.ag-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.75rem;
}

.ag-msg.assistant .ag-avatar {
  background: linear-gradient(135deg, #059669 0%, #06b6d4 100%);
  color: #0b0f17;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.ag-msg.user .ag-avatar {
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  color: #ffffff;
}

.ag-bubble {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
}

.ag-msg.user .ag-bubble {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(59, 130, 246, 0.15) 100%);
  border-color: rgba(139, 92, 246, 0.35);
  border-top-right-radius: 4px;
}

.ag-msg.assistant .ag-bubble {
  border-top-left-radius: 4px;
  border-color: rgba(6, 182, 212, 0.2);
}

.ag-bubble pre {
  background: #080d14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin: 0.6rem 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.ag-bubble code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.ag-bubble pre code {
  background: transparent;
  padding: 0;
}

/* CARDS DE ANEXOS DENTRO DA BOLHA */
.msg-attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.msg-file-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(11, 15, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  color: #38bdf8;
}

.msg-image-thumb {
  max-width: 220px;
  max-height: 160px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s;
}

.msg-image-thumb:hover {
  transform: scale(1.03);
}

.msg-audio-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.4rem;
}

.learned-insight-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  margin-top: 0.5rem;
}

/* CHIPS DE SUGESTÃO */
.chat-quick-suggestions {
  padding: 0.5rem 1.25rem;
  background: rgba(11, 15, 23, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
}

.suggestions-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

.suggestion-chip {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s;
}

.suggestion-chip:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: #38bdf8;
}

/* DOCK DE INPUT MULTIMODAL */
.antigravity-input-dock {
  background: rgba(11, 15, 23, 0.85);
  border-top: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
}

.attachments-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding: 0.45rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.attached-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #e2e8f0;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.btn-remove-attachment {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 0.1rem;
}

.btn-remove-attachment:hover {
  color: #f87171;
}

/* BARRA DE GRAVAÇÃO DE VOZ */
.audio-recording-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  margin-bottom: 0.65rem;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fca5a5;
}

.recording-pulse {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulseRing 1.2s infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.recording-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.recording-waveform span {
  width: 3px;
  background: #f87171;
  border-radius: 2px;
  animation: soundWave 1s infinite ease-in-out;
}

.recording-waveform span:nth-child(2) { animation-delay: 0.15s; }
.recording-waveform span:nth-child(3) { animation-delay: 0.3s; }
.recording-waveform span:nth-child(4) { animation-delay: 0.45s; }
.recording-waveform span:nth-child(5) { animation-delay: 0.2s; }
.recording-waveform span:nth-child(6) { animation-delay: 0.35s; }
.recording-waveform span:nth-child(7) { animation-delay: 0.5s; }

@keyframes soundWave {
  0%, 100% { height: 4px; }
  50% { height: 18px; }
}

.btn-cancel-recording {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-stop-recording {
  background: #ef4444;
  border: none;
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* INPUT ROW */
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.6rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-row:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.input-actions-left {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-attach {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-attach:hover {
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.12);
}

.btn-attach.btn-voice:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

#antigravityPromptInput {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  resize: none;
  outline: none;
  max-height: 140px;
  line-height: 1.5;
  padding: 0.35rem 0.25rem;
}

.btn-send-antigravity {
  background: linear-gradient(135deg, #059669 0%, #06b6d4 100%);
  border: none;
  color: #0b0f17;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.btn-send-antigravity:hover {
  transform: scale(1.04);
  opacity: 0.95;
}

.input-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.vps-active-status {
  color: #34d399;
  font-weight: 600;
}

/* PAINEL DIREITO: PROMPT MESTRE AO VIVO */
.antigravity-prompt-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.prompt-panel-header {
  padding: 1rem;
  background: rgba(11, 15, 23, 0.8);
  border-bottom: 1px solid var(--border-color);
}

.prompt-status-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  margin-bottom: 0.35rem;
}

.panel-header-title h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.prompt-panel-tabs {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
}

.prompt-subtab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.35rem 0.2rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.prompt-subtab.active {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  font-weight: 700;
}

.prompt-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
}

.subtab-pane {
  display: none;
  flex-direction: column;
  height: 100%;
}

.subtab-pane.active {
  display: flex;
}

.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.prompt-actions-row {
  display: flex;
  gap: 0.35rem;
}

.btn-copy-code-sm {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s;
}

.btn-copy-code-sm:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-download-sm {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.prompt-code-display {
  flex: 1;
  background: #070b12;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #93c5fd;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  max-height: 520px;
}

/* CHECKLIST */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.5rem 0;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
}

.check-item input[type="checkbox"] {
  accent-color: #10b981;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.prompt-panel-footer {
  padding: 0.75rem 1rem;
  background: rgba(11, 15, 23, 0.8);
  border-top: 1px solid var(--border-color);
}

.btn-ask-refine {
  width: 100%;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ask-refine:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
  border-color: #38bdf8;
}

/* ==================== BIBLIOTECA DE MODELOS DE PROMPT ==================== */
.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-template-library {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-template-library:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.tpl-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(3, 7, 15, 0.72);
  backdrop-filter: blur(8px);
  animation: tplFade 0.2s ease-out;
}

.tpl-overlay[hidden],
.tpl-view[hidden] {
  display: none !important;
}

@keyframes tplFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.tpl-modal {
  width: min(1100px, 100%);
  height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(18, 24, 38, 0.97) 0%, rgba(11, 15, 23, 0.98) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(16, 185, 129, 0.08);
  overflow: hidden;
  animation: tplRise 0.25s ease-out;
}

.tpl-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.tpl-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.tpl-modal-header h3 {
  margin: 0.25rem 0 0.3rem;
  font-size: 1.35rem;
  color: var(--text-main);
}

.tpl-modal-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tpl-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.tpl-close:hover {
  color: #fff;
  border-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.12);
}

.tpl-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.6rem 1.4rem;
  gap: 1rem;
}

.tpl-search {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-dim);
}

.tpl-search svg {
  position: absolute;
  left: 0.85rem;
}

.tpl-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem 0.7rem 2.4rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tpl-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.tpl-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  align-content: start;
  padding-right: 0.25rem;
}

.tpl-card {
  --tpl-accent: #10b981;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.tpl-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tpl-accent), transparent);
}

.tpl-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tpl-accent) 55%, transparent);
  box-shadow: 0 14px 34px -14px color-mix(in srgb, var(--tpl-accent) 45%, transparent);
}

.tpl-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tpl-icon {
  font-size: 1.6rem;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tpl-accent) 14%, transparent);
}

.tpl-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tpl-accent);
}

.tpl-title {
  margin: 0.2rem 0 0;
  font-size: 1.02rem;
  color: var(--text-main);
  line-height: 1.35;
}

.tpl-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.tpl-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tpl-stack span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.tpl-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

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

.tpl-btn-ghost,
.tpl-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.tpl-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.tpl-btn-ghost:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.tpl-btn-primary {
  background: linear-gradient(135deg, #059669 0%, #0891b2 100%);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}

.tpl-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.4);
}

.tpl-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.tpl-preview-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tpl-preview-info {
  flex: 1;
  min-width: 200px;
}

.tpl-preview-info h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-main);
}

.tpl-preview-info span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tpl-preview-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tpl-preview-code {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 1.1rem 1.2rem;
  background: rgba(3, 7, 15, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 640px) {
  .tpl-overlay { padding: 0.5rem; }
  .tpl-modal { height: 94vh; }
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl-view, .tpl-modal-header { padding-left: 1rem; padding-right: 1rem; }
}

