/* ==================== PALETA DE 3 COLORES ==================== */
:root {
  /* Colores principales - Rojo moderno, Blanco y Gris */
  --primary: #DC2626;
  --primary-hover: #B91C1C;
  --primary-light: #EF4444;

  /* Colores de estado */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* Fondos - Blancos y grises */
  --bg-page: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-hover: #F5F5F5;
  --bg-secondary: #E5E5E5;

  /* Texto - Grises y negro */
  --text-primary: #1A1A1A;
  --text-secondary: #374151;
  --text-muted: #6B7280;

  /* Bordes */
  --border-color: #E5E5E5;
  --border-focus: #DC2626;

  /* Sombras suaves */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Espaciado */
  --space-xs: 4px;
  --space-sm: 8px;
  --space: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
}

/* ==================== RESET Y BASE ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  min-height: 100vh;
}

body {
  margin: 0;
  color: var(--text-primary);
  background: var(--bg-page);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  width: 100%;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* En pantallas con apps "full height" (ej: editor X Spaces), permitir que el main se encoja
   y evitar que el contenido largo empuje el footer dentro del viewport. */
.main-content.main-flex-tight {
  min-height: 0;
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================== NAVBAR ==================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  backdrop-filter: blur(8px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space);
}
.nav-credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  font-weight: 700;
  color: #111827;
}
.nav-credits .credits-label {
  font-size: 12px;
  color: #6b7280;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-credits .credits-value { font-size: 14px; }

.logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #B91C1C);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.logo:hover {
  transform: scale(1.05);
}

.logo::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 12px solid white;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 2px;
}

.brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.brand:hover {
  text-decoration: none;
  color: var(--primary);
}

.domain {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
}

/* ==================== DROPDOWN ==================== */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-sm));
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  min-width: 220px;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

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

.dropdown.open .dropdown-menu {
  display: flex;
}

.dropdown-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.dropdown-header strong {
  color: var(--text-primary);
  font-size: 14px;
}

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

.dropdown-menu a {
  padding: var(--space) var(--space-md);
  color: var(--text-primary);
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:last-child {
  border-bottom: none;
}

.dropdown-menu a:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.dropdown-menu form {
  padding: 0;
  margin: 0;
}

/* ==================== AVATAR ==================== */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  object-fit: cover;
}

/* ==================== BOTONES ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space) var(--space-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

a.btn {
  text-align: right;
}

.btn-primary,
.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  border: none;
}

.btn-primary:hover,
.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-light) 100%);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  border: none;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger,
.btn.danger {
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  border: none;
}

.btn-danger:hover,
.btn.danger:hover {
  background: linear-gradient(135deg, #991B1B 0%, #7F1D1D 100%);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

.btn-ghost,
.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.btn-ghost:hover,
.btn.ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: none;
}

.btn-sync {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  border: none;
}

.btn-sync:hover {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-block {
  width: 100%;
  text-align: center;
}

.btn-lg {
  padding: var(--space-md) var(--space-lg);
  font-size: 16px;
}

/* ==================== CARDS Y PANELES ==================== */
.panel, .card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.panel h2, .card h2 {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel h3, .card h3 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== MENSAJES FLASH ==================== */
.flash-list {
  list-style: none;
  margin: var(--space-lg) 0;
  padding: 0;
}

.flash {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  margin-bottom: var(--space);
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

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

.flash.success, .flash.ok {
  background: var(--success-light);
  border-color: var(--success);
  color: #991B1B;
}

.flash.error, .flash.danger {
  background: var(--danger-light);
  border-color: var(--danger);
  color: #991B1B;
}

.flash.warning {
  background: var(--warning-light);
  border-color: var(--warning);
  color: #92400E;
}

.flash.info {
  background: var(--info-light);
  border-color: var(--info);
  color: #1E40AF;
}

/* ==================== FORMULARIOS ==================== */
.form-group {
  margin-bottom: var(--space-lg);
}

label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: var(--space) var(--space-md);
  font-size: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* ==================== TABLAS ==================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

th {
  background: var(--bg-secondary);
  padding: var(--space) var(--space-md);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: var(--bg-hover);
}

/* ==================== BADGES Y PILLS ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.badge.ok,
.badge-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge.err,
.badge-danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.badge-warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-info {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ==================== UTILIDADES ==================== */
.text-center {
  text-align: center;
}

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.p-1 { padding: var(--space); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

/* ==================== APPS TOOLKIT ==================== */
.apps-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-secondary) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.apps-header-icon {
  font-size: 48px;
  line-height: 1;
}

.apps-header-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

.search-box {
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.search-box-icon {
  font-size: 24px;
  color: var(--primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.search-box input {
  flex: 1;
  padding: var(--space-md);
  font-size: 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  outline: none;
}

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

.app-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  transition: all 0.2s ease;
  overflow: hidden;
}

.app-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
  transform: translateY(-2px);
}

.app-link {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
}

.app-link:hover {
  text-decoration: none;
}

.app-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  transition: transform 0.2s ease;
}

.app-item:hover .app-icon {
  transform: scale(1.1);
}

.app-info {
  flex: 1;
}

.app-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs) 0;
}

.app-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.app-arrow {
  flex-shrink: 0;
  font-size: 24px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.app-item:hover .app-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* App Tags (dev, beta, new, etc.) */
.app-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.app-tag-dev {
  background: var(--warning-light);
  color: #92400E;
}

.app-tag-beta {
  background: var(--info-light);
  color: #1E40AF;
}

.app-tag-new {
  background: var(--success-light);
  color: #065F46;
}

.no-results {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-secondary);
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

/* ==================== FOOTER ==================== */
.footer {
  margin-top: var(--space-2xl);
  padding: var(--space-xl) 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ==================== YouTube Count Workspace ==================== */
.yt-workspace { margin-top: 12px; }
.yt-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 3rem;
  max-width: 1280px;
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .yt-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .yt-pane-left { grid-column: span 4 / span 4; }
  .yt-pane-right { grid-column: span 8 / span 8; }
}
.yt-pane-right { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) {
  .yt-pane-left .control-card { position: sticky; top: 24px; }
}
.card-modern {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.06);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.workspace-title { margin: 4px 0 6px; color: #111827; font-size: 1.6rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  margin: 0;
}
.card-title-sm { margin: 2px 0 0; color: #111827; font-weight: 700; font-size: 1.1rem; }
.control-card .muted.small { margin: 0; }
.control-form .form-stack { display: flex; flex-direction: column; gap: 10px; }
.field-compact { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; color: #111827; font-size: 0.9rem; }
.input-compact {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input-compact:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  background: #ffffff;
}
.actions.stacked { display: flex; flex-direction: column; gap: 8px; }
.actions.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions.actions-clean { display: flex; flex-direction: column; gap: 6px; }
.actions.action-row { display: flex; align-items: stretch; gap: 10px; }
.btn-block { width: 100%; text-align: center; justify-content: center; }
.action-primary { flex: 3; }
.action-secondary { flex: 1; display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.action-row-tail { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.btn-clean {
  background: transparent;
  border: none;
  color: #6b7280;
  padding: 4px 0 0;
  text-align: left;
  cursor: pointer;
}
.btn-clean:hover { color: #111827; text-decoration: underline; }
.input-action-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
}
.icon-btn.subtle {
  width: 34px;
  height: 38px;
  border-radius: 8px;
  background: #f9fafb;
}
.secondary-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.video-context { display: flex; flex-direction: column; gap: 14px; }
.video-frame { width: 100%; }
.video-frame .embed-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #0f172a;
}
.embed-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame.placeholder .embed-wrapper { display: none; }
.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  text-align: center;
  padding: 16px;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px) {
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.meta-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.meta-label { margin: 0 0 4px; font-size: 0.85rem; color: #6b7280; }
.meta-value { margin: 0; font-size: 1.4rem; font-weight: 700; color: #111827; }
.meta-note { margin: 2px 0 0; color: #6b7280; font-size: 0.85rem; }
.text-up { text-transform: uppercase; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-head.tight { align-items: center; }
.recent-list {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.recent-compact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.recent-compact li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid #f1f5f9;
}
.recent-compact li:last-child { border-bottom: none; }
.recent-compact .recent-extra { display: none; }
.recent-compact .recent-extra.is-visible { display: flex; }
.recent-line { display: flex; align-items: baseline; gap: 10px; width: 100%; }
.recent-term { font-weight: 600; color: #111827; }
.recent-date { margin-left: auto; }
.recent-repeat {
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  color: #dc2626;
  text-decoration: none;
  font-weight: 700;
}
.recent-compact li:hover .recent-repeat { opacity: 1; transform: translateX(2px); }
.recent-repeat:hover { text-decoration: underline; }
.recent-more {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  width: 36px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.recent-more:hover { background: #f3f4f6; border-color: #d1d5db; }
.recent-hint { margin: 6px 0 0; }
.recent-head { align-items: center; }
.xsmall { font-size: 0.8rem; }
.context-stack { display: flex; flex-direction: column; gap: 14px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 120;
}
.modal-card {
  background: #fff;
  border-radius: 14px;
  width: min(720px, 95vw);
  max-height: 80vh;
  overflow: auto;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 40px rgba(0,0,0,0.18);
  padding: 16px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
}
.modal-close:hover { background: #f3f4f6; }
.recent-modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.recent-modal-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid #f1f5f9;
}
.recent-modal-list li:last-child { border-bottom: none; }
.heatmap-card, .results-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15,23,42,0.05);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 8px 0 4px;
}
.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}
.stat-cell:not(:last-child) { border-right: 1px solid #d1d5db; }
.stat-label {
  margin: 0;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stat-value { margin: 0; font-size: 1.4rem; font-weight: 800; color: #111827; }
.meta-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.meta-chip {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
}
.meta-chip-label { margin: 0 0 2px; font-size: 0.82rem; color: #6b7280; }
.meta-chip-value { margin: 0; font-size: 1.1rem; font-weight: 700; color: #111827; }
.meta-chip-note { margin: 2px 0 0; font-size: 0.8rem; color: #6b7280; }
.heatmap-bar {
  position: relative;
  height: 48px;
  border-radius: 12px;
  background: #e5e7eb;
  overflow: hidden;
}
.heatmap-bar.disabled::after { display: none; }
.heatmap-tick {
  position: absolute;
  top: 0;
  width: 3px;
  height: 100%;
  background: #dc2626;
  opacity: 0.9;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.heatmap-tick:hover { background: #b91c1c; transform: translateY(-2px); }
.heatmap-hint { margin: 0; }
.heatmap-placeholder { display: flex; flex-direction: column; gap: 10px; }
.results-table-wrap { max-height: 70vh; overflow: auto; }
.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.results-table thead th {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 2;
  text-align: left;
  padding: 10px;
  font-size: 0.9rem;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
}
.results-table tbody td {
  padding: 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1f2937;
}
.results-card mark {
  background: #fef08a;
  color: #111827;
  border-radius: 6px;
  padding: 0 2px;
}
.results-table tbody tr:hover { background: #f8fafc; }
.timestamp-link { color: #2563eb; font-weight: 600; text-decoration: none; }
.timestamp-link::before {
  content: "▶";
  display: inline-block;
  margin-right: 6px;
  font-size: 12px;
}
.timestamp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.timestamp-link:hover {
  text-decoration: none;
  background: #eef2ff;
  color: #1d4ed8;
}
.results-empty {
  padding: 14px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
}
.heatmap-card .pill, .results-card .pill { background: #fef2f2; color: #b91c1c; border-color: #fecdd3; }
.card-modern .pill { align-self: flex-start; }
.card-head-actions { display: inline-flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

/* ==================== Credits Pricing ==================== */
.credits-hero {
  text-align: center;
}
.credits-header h1 { margin: 0 0 10px; }
.credits-subtitle {
  color: #6b7280;
  max-width: 720px;
  margin: 0 auto;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  max-width: 960px;
  margin: 40px auto 0;
}
.pricing-card {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid #f3f4f6;
  box-shadow: 0 18px 38px rgba(0,0,0,0.05);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pricing-card.featured {
  border-color: #ef4444;
  box-shadow: 0 20px 44px rgba(239, 68, 68, 0.12);
}
.badge-popular {
  position: absolute;
  top: -12px;
  right: 18px;
  background: #ef4444;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.pricing-card-head { display: flex; justify-content: space-between; align-items: center; }
.pricing-title { margin: 0; font-size: 1.2rem; font-weight: 800; color: #0f172a; }
.pricing-price { display: flex; align-items: baseline; gap: 10px; }
.price-amount { font-size: 2.5rem; font-weight: 900; color: #0f172a; }
.price-note { color: #6b7280; font-weight: 600; }
.pricing-desc { margin: 0; color: #4b5563; }
.pricing-divider { border-top: 1px solid #f1f5f9; margin: 6px 0 4px; }
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pricing-features .check { color: #16a34a; font-weight: 800; margin-right: 8px; }
.pricing-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: transparent;
  color: #111827;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pricing-btn:hover { background: #f3f4f6; }
.pricing-btn.primary {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: #dc2626;
}
.pricing-btn.primary:hover { background: #dc2626; }
.pricing-btn.ghost {
  background: #fff;
  color: #111827;
}
.credits-footer {
  margin-top: 18px;
  text-align: center;
  color: #4b5563;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .container {
    padding: var(--space-md) var(--space);
  }

  .nav {
    padding: var(--space) var(--space-md);
  }

  .panel, .card {
    padding: var(--space-lg);
  }

  .nav-left {
    gap: var(--space-sm);
  }

  .domain {
    display: none;
  }

  .apps-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .apps-header-title {
    font-size: 24px;
  }

  .app-link {
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .app-icon {
    width: 48px;
    height: 48px;
    font-size: 32px;
  }

  .app-name {
    font-size: 16px;
  }

  .app-description {
    font-size: 13px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: var(--space);
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* ==================== PERFIL Y SUSCRIPCIÓN ==================== */
/* Solo aplicar estos estilos a h3 que están directamente en .panel, no en .card */
.panel > h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space);
}

.panel > h3::before {
  content: "";
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 2px;
}

/* Mantener estilos normales para h3 dentro de .card dentro de .panel */
.panel .card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space);
  padding-bottom: 0;
  border-bottom: none;
  display: block;
}

.panel .card h3::before {
  content: none;
}

.subscription-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.subscription-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-secondary) 100%);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.subscription-card h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 var(--space-sm) 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscription-card .value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.field {
  margin-bottom: var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

input[readonly], input[disabled] {
  background: var(--bg-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ==================== SPINNER ==================== */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin-right: var(--space-sm);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading .btn-text {
  opacity: 0.5;
}

/* ==================== SYNC BUTTON ==================== */
.btn-sync {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 14px;
  padding: var(--space-sm) var(--space-md);
}

.btn-sync:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

/* ==================== NOTIFICATION BELL ==================== */
.notification-bell-wrapper {
  position: relative;
  display: inline-flex;
}

.notification-bell {
  position: relative;
  padding: 0.5rem;
  font-size: 1.2rem;
}

.bell-icon {
  display: inline-block;
  transition: transform 0.2s;
}

.notification-bell:hover .bell-icon {
  transform: rotate(15deg);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  background: var(--danger);
  color: #fff;
  border-radius: 9px;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 2000;
  overflow: hidden;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}
.notification-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.notification-list {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.2s;
}

.notif-item:hover {
  background: var(--bg-hover);
}

.notif-item.unread {
  background: var(--info-light);
}

.notif-item.unread:hover {
  background: #c7d9f4;
}

.notif-title {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.notif-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Notification items (used by JS) */
.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.notification-item:hover {
  background: var(--bg-hover);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item.unread {
  /* Estilo por defecto para notificaciones normales no leídas - sin color especial */
}

.notification-item.unread:hover {
  background: var(--bg-hover);
}

.notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 50%;
  font-size: 1rem;
}

/* Notificaciones normales - sin color especial */
.notification-item.unread .notification-icon {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Notificaciones de éxito (job_complete) - verde */
.notification-item.notification-success .notification-icon {
  background: var(--success);
  color: #fff;
}

.notification-item.notification-success.unread {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--success);
}

.notification-item.notification-success.unread:hover {
  background: rgba(16, 185, 129, 0.15);
}

/* Notificaciones de error (job_failed) - rojo */
.notification-item.notification-error .notification-icon {
  background: var(--danger);
  color: #fff;
}

.notification-item.notification-error.unread {
  background: rgba(231, 76, 60, 0.1);
  border-left: 3px solid var(--danger);
}

.notification-item.notification-error.unread:hover {
  background: rgba(231, 76, 60, 0.15);
}

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

.notification-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
}

.notification-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Modo toggle XSpaces */
.mode-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mode-toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.mode-toggle-option input {
  accent-color: #ff6b00;
  width: 16px;
  height: 16px;
}
.mode-toggle-btn {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-weight: 600;
}
.mode-free {
  color: #0f9d58;
}
.mode-fast {
  color: #d97706;
}

/* Landing hero */
.hero-landing {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: linear-gradient(120deg, #f8fafc, #f1f5f9);
  margin-bottom: 20px;
}
.hero-landing .badge {
  display: inline-block;
  padding: 6px 12px;
  background: #e0f2fe;
  color: #075985;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 8px;
}
.hero-landing h1 {
  margin: 0 0 8px;
}
.hero-landing .lede {
  color: #334155;
  margin-bottom: 12px;
}
.hero-landing .benefits {
  list-style: disc;
  padding-left: 20px;
  color: #334155;
  margin-bottom: 12px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-support {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}
.donate-btn img {
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

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


/* Account / Settings shell */
.settings-shell {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 0;
  margin-left: calc(-1 * var(--space-md));
  margin-right: calc(-1 * var(--space-md));
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}
.settings-sidebar {
  flex: 0 0 200px;
  width: 200px;
  border-right: 1px solid #e5e7eb;
  padding: 12px 16px 12px 0;
}
.sidebar-header h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 600;
  margin: 0;
}
.sidebar-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #4b5563;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.sidebar-link:hover {
  background: #f9fafb;
  color: #111827;
  border-color: #e5e7eb;
}
.sidebar-link.active {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecdd3;
  font-weight: 600;
}
.settings-content {
  flex: 1;
  max-width: 100%;
  width: calc(100% - 200px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.content-header h2 {
  margin: 4px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}
.content-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.settings-panel {
  display: none;
}
.settings-panel.active {
  display: block;
}
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.data-table th { font-size: 0.9rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.02em; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat-card .stat-value { font-size: 1.4rem; font-weight: 700; }
.stat-card .stat-label { color: #6b7280; font-size: 0.9rem; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); border-color: #d1d5db; }
.stat-card.active { border-color: #dc2626; box-shadow: 0 0 0 1px rgba(220,38,38,0.15); }
.stat-card.stat-pending { background: #fffbeb; }
.stat-card.stat-processing { background: #eff6ff; }
.stat-card.stat-paused { background: #f3f4f6; }
.stat-card.stat-completed { background: #ecfdf3; }
.stat-card.stat-failed { background: #fef2f2; }
.action-buttons { display: flex; flex-direction: column; gap: 4px; }
.progress-mini { width: 100px; height: 8px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.progress-mini-bar { height: 100%; background: linear-gradient(90deg, #dc2626, #f97316); }
.progress-text { font-size: 0.85rem; color: #374151; margin-left: 8px; }
.priority-select { padding: 4px 8px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; }
.status-badge { padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; text-transform: capitalize; }
.status-pending { background: #fffbeb; color: #92400e; }
.status-processing { background: #eff6ff; color: #1d4ed8; }
.status-completed { background: #ecfdf3; color: #065f46; }
.status-failed { background: #fef2f2; color: #991b1b; }
.status-paused { background: #f3f4f6; color: #374151; }
.job-type-badge { padding: 4px 8px; border-radius: 8px; background: #eef2ff; color: #3730a3; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.space-id { font-size: 0.85rem; color: #111827; }
.user-email { font-size: 0.9rem; color: #111827; }
.error-row { background: #fff1f2; }
.error-message { color: #991b1b; font-size: 0.9rem; }
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.account-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  color: #1a1a1a;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.account-card.tight {
  padding: 18px;
  background: #f9fafb;
}
.account-main h2 {
  margin-bottom: 16px;
  color: #111827;
  font-size: 1.5rem;
  font-weight: 700;
}
.account-card h3, .account-card h4 {
  margin: 0 0 4px;
  color: #111827;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}
.account-card.nested {
  padding: 16px;
  border: 1px dashed #e5e7eb;
  box-shadow: none;
}
.price.big {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 6px 0 8px;
}
.account-form input {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  color: #111827;
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  font-size: 14px;
  transition: all 0.2s ease;
}
.account-form input:disabled,
.account-form input:read-only {
  background: #e5e7eb;
  color: #6b7280;
  cursor: not-allowed;
}
.account-form input:focus {
  outline: none;
  background: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.divider {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 16px 0;
}
.grid.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.grid.two-cols .field.full { grid-column: 1 / -1; }
.muted.small {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 12px;
}
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}
.flash-list { list-style: none; padding: 0; margin: 0 0 16px; }
.flash-list li {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 0.875rem;
}
.flash-list li.success {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}
.flash-list li.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.account-sidebar { display: flex; flex-direction: column; gap: 10px; }
.status-pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  margin: 8px 0;
}
.status-free {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
.status-active {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.status-inactive {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
.sidebar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin: 16px 0;
}
.sidebar-grid > div {
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.sidebar-grid .value {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
  margin-top: 4px;
}
.sidebar-grid .muted {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.account-actions { margin-top: 16px; }
.btn.btn-primary {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  font-weight: 600;
}
.btn.btn-primary:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.2);
}
.btn.btn-secondary {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
  font-weight: 600;
}
.btn.btn-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

@media (max-width: 900px) {
  .settings-shell {
    flex-direction: column;
    padding: 12px;
    margin-left: 0;
    margin-right: 0;
  }
  .settings-sidebar {
    width: 100%;
    flex: 1 1 auto;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 0 12px;
  }
  .settings-content { width: 100%; }
}
.btn.btn-ghost {
  background: transparent;
  color: #374151;
  border: 1px solid #d1d5db;
  font-weight: 500;
}
.btn.btn-ghost:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}
@media (max-width: 960px) {
  .account-grid { grid-template-columns: 1fr; }
}


/* Bento grid layout */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
  background: #f9fafb;
  padding: 1rem;
}
@media (min-width: 768px) {
  .bento-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.bento-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}
.col-span-2 {
  grid-column: span 2 / span 2;
}
.col-span-3 {
  grid-column: span 3 / span 3;
}
@media (max-width: 767px) {
  .col-span-2 { grid-column: span 1 / span 1; }
  .col-span-3 { grid-column: span 1 / span 1; }
}
.hero-card { min-height: 280px; display: flex; }
.hero-content { display: flex; justify-content: space-between; gap: 1rem; height: 100%; flex: 1; width: 100%; }
.hero-content.hero-tools { width: 100%; }
.hero-content.hero-tools .hero-text { flex: 1; min-width: 0; }
.hero-content h1 { color: #111827; margin: 0 0 10px; }
.hero-content .lede { color: #4b5563; margin: 0 0 8px; }
.hero-content .benefits { color: #4b5563; margin: 0; padding-left: 18px; }
.donate-inline { display: flex; align-items: flex-end; }
.donate-link { color: #d32f2f; font-weight: 700; text-decoration: none; }
.donate-link:hover { text-decoration: underline; }
.badge-highlight {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.donate-btn-modern {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fbbf24;
  color: #111827;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  border: 1px solid #f59e0b;
  transition: background 0.15s ease, transform 0.15s ease;
}
.donate-btn-modern:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}
.card-title { margin: 0 0 8px; color: #111827; }
.search-box.compact { background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; }
.search-box.compact input { background: transparent; border: none; outline: none; }
.app-hub { display: flex; flex-direction: column; gap: 1rem; }
.app-hub-header { display: flex; flex-direction: column; gap: 0.5rem; }
.toolbar-row { display: flex; gap: 10px; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.app-hub .toolbar-row { column-gap: 14px; row-gap: 10px; }
.app-hub .search-box.compact {
  flex: 1 1 420px;
  max-width: 760px;
  min-width: 260px;
  padding: 8px 12px;
  border-radius: 10px;
}
.app-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.app-hub-header .card-title { margin: 0; }
.app-hub-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.app-hub .search-box.compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
  width: 16rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.app-hub .search-box.compact .search-box-icon {
  width: 22px;
  height: 22px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-hub .search-box.compact input {
  width: 100%;
  font-size: 0.95rem;
  border: none;
  outline: none;
  background: transparent;
}
.floating-notice {
  position: fixed;
  top: 92px;
  right: 20px;
  max-width: 320px;
  background: #0f172a;
  color: #f9fafb;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 90;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.floating-notice .notice-title { margin: 0 0 4px; font-weight: 700; }
.floating-notice .notice-body { margin: 0; color: #e5e7eb; font-size: 0.9rem; }
.floating-notice .notice-close {
  background: transparent;
  border: none;
  color: #dc2626;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.floating-notice .notice-close:hover { color: #b91c1c; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.apps-grid[data-view="compact"] { grid-template-columns: 1fr; gap: 0.75rem; }
.apps-grid[data-view="icons"] { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.app-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  border: 1px solid #e5e7eb;
  position: relative;
}
.app-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(220,38,38,0.12); border-color: #e5e7eb; }
.app-card.view-normal { padding: 20px; gap: 8px; }
.app-card.view-compact {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.app-card.view-icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  gap: 8px;
  min-height: 110px;
  aspect-ratio: 1 / 1;
  max-width: 180px;
  margin: 0 auto;
  cursor: pointer;
}
.app-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; width: 100%; }
.app-icon.pill { background: #fee2e2; color: #d32f2f; padding: 10px; border-radius: 12px; font-size: 1.4rem; display: inline-flex; }
.app-card-body { margin-bottom: 10px; }
.app-card-body .app-name { margin: 0 0 6px; color: #111827; }
.app-card-body .app-description { margin: 0; color: #4b5563; }
.app-card-footer { display: flex; justify-content: flex-end; gap: 6px; }
.app-card.view-compact .app-card-header { margin: 0; justify-content: flex-start; gap: 8px; }
.app-card.view-compact .app-card-body {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  min-width: 0;
  flex-wrap: nowrap;
}
.app-card.view-compact .app-name,
.app-card.view-compact .app-description {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-card.view-compact .app-name { flex-shrink: 0; }
.app-card.view-compact .app-description { flex: 1; }
.app-card.view-compact .app-card-footer { margin: 0; justify-content: flex-end; }
.app-card.view-compact .app-icon { width: 44px; height: 44px; font-size: 22px; justify-content: center; align-items: center; }
.app-card.view-icons .app-card-header { margin: 0; justify-content: center; align-items: center; }
.app-card.view-icons .app-card-body { margin: 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.app-card.view-icons .app-description { display: none; }
.app-card.view-icons .app-card-footer { display: none; }
.app-card.view-icons .app-icon { width: 72px; height: 72px; font-size: 36px; justify-content: center; align-items: center; }
.app-card.view-icons .app-name { font-size: 0.95rem; font-weight: 600; margin: 0; }
.app-card.view-icons .app-tag-dev {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
  padding: 4px 8px;
  font-size: 0.7rem;
}
.app-card.view-icons:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}
.btn.btn-ghost { color: #374151; border: 1px solid #d1d5db; }
.btn.btn-ghost:hover { color: #111827; border-color: #111827; background: #f9fafb; }
.app-tag-dev { background: #e5e7eb; color: #374151; padding: 4px 8px; border-radius: 999px; font-size: 0.75rem; }
.app-tag-dev.subtle { background: #f5f5f5; color: #9ca3af; font-weight: 600; font-size: 0.7rem; }
.btn.btn-sm { padding: 6px 10px; font-size: 0.9rem; }
.app-card-footer .btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  border: 1px solid #c62828;
}
.app-card-footer .btn-primary:hover {
  background: #fff;
  color: #c62828;
  border-color: #c62828;
  box-shadow: 0 6px 18px rgba(198, 40, 40, 0.25);
}
.view-toggle.segmented {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 12px;
}
.view-toggle .toggle-btn {
  background: transparent;
  border: none;
  padding: 8px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.view-toggle .toggle-btn span[aria-hidden="true"] { font-size: 18px; line-height: 1; }
.view-toggle .toggle-btn:hover { background: rgba(255,255,255,0.8); color: #374151; }
.view-toggle .toggle-btn.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}


/* Nav polish: bell + profile */
.notification-bell-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1px solid #e5e7eb;
}
.notification-bell {
  position: relative;
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 999px;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.15s ease, background 0.15s ease;
}
.notification-bell:hover { color: #1f2937; background: #f3f4f6; }
.bell-icon { width: 22px; height: 22px; display: block; }
.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #d32f2f;
  border-radius: 50%;
}
.jobs-wrapper {
  position: relative;
  margin-right: 12px;
}
.jobs-btn {
  background: transparent;
  border: 1px solid #e5e7eb;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #374151;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.jobs-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.jobs-icon { font-size: 16px; }
.jobs-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.jobs-dropdown {
  position: absolute;
  top: 110%;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  padding: 10px;
  width: 260px;
  z-index: 2000;
}
.jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.jobs-head .icon-btn {
  color: #000000;
}

.jobs-head .icon-btn:hover {
  color: #000000;
}
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.job-item {
  padding: 8px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.job-main { min-width: 0; }
.job-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.job-title { margin: 0; font-weight: 600; color: #111827; }
.job-meta { margin: 0; color: #6b7280; font-size: 0.85rem; }
.job-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.job-status.pending { background: #fff7ed; color: #c2410c; }
.job-status.processing { background: #eff6ff; color: #1d4ed8; }
.job-status.completed { background: #ecfdf3; color: #15803d; }
.job-status.failed { background: #fef2f2; color: #b91c1c; }
.job-status.paused { background: #f3f4f6; color: #374151; }

.job-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.job-icon-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}
.job-icon-btn:hover { background: #f3f4f6; }
.job-icon-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.job-icon-btn.danger { border-color: #fecaca; }
.job-icon-btn.danger:hover { background: #fef2f2; }

.nav-profile .dropdown-toggle {
  background: transparent;
  border: none;
  padding: 0;
}
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.profile-trigger:hover { background: #f9fafb; }
.profile-name { font-weight: 600; color: #111827; }
.nav .avatar { border: none; }
.chevron { color: #6b7280; font-size: 0.9rem; }

.nav .dropdown-menu { margin-top: 6px; }
