/* ==========================================================================
   XISPEH APPS — DESIGN SYSTEM OFICIAL (design.xispeh.com)
   Tokens, Tipografia Space Grotesk, Cores e Componentes
   ========================================================================== */

:root {
  /* Tokens Oficiais Xispeh Design System */
  --c-bg: #121111;
  --c-black-deep: #0a0a0a;
  --c-black-mid: #161515;
  --c-orange: #FF8D07;
  --c-orange-bright: #FFA033;
  --c-orange-dark: #CC7006;
  --c-orange-glow: rgba(255, 141, 7, 0.12);
  --c-orange-subtle: rgba(255, 141, 7, 0.06);

  --c-white: #F5F5F5;
  --c-white-mid: rgba(245, 245, 245, 0.7);
  --c-white-muted: rgba(245, 245, 245, 0.4);
  --c-white-faint: rgba(245, 245, 245, 0.1);

  --c-surface: rgba(255, 255, 255, 0.03);
  --c-surface-hover: rgba(255, 255, 255, 0.06);
  --c-surface-glass: rgba(255, 255, 255, 0.04);

  --c-border: rgba(255, 141, 7, 0.16);
  --c-border-subtle: rgba(255, 255, 255, 0.07);
  --c-border-strong: rgba(255, 141, 7, 0.35);

  --f-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ls: -0.05em;
  --ls-body: -0.025em;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 100px;
  --r-full: 9999px;

  /* Mapeamento Semântico para a Aplicação */
  --bg-canvas: var(--c-bg);
  --bg-surface: var(--c-black-mid);
  --bg-surface-raised: #1c1b1b;
  --bg-surface-hover: #262424;
  --bg-overlay: rgba(10, 10, 10, 0.85);

  --border-subtle: var(--c-border-subtle);
  --border-prominent: var(--c-border);
  --border-focus: var(--c-orange);

  --text-primary: var(--c-white);
  --text-secondary: var(--c-white-mid);
  --text-muted: var(--c-white-muted);
  --text-danger: #f87171;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.7), 0 2px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 20px 40px -8px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 141, 7, 0.18);
  --shadow-glow: 0 0 18px rgba(255, 141, 7, 0.18);
  --shadow-glow-strong: 0 0 30px rgba(255, 141, 7, 0.25), 0 0 60px rgba(255, 141, 7, 0.1);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* Reset Básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--c-bg);
  color: var(--c-white);
  font-family: var(--f-body);
  font-weight: 300;
  letter-spacing: var(--ls-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 141, 7, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Scroll Personalizado Oficial Xispeh Design System */
body::-webkit-scrollbar {
  width: 10px;
}
body::-webkit-scrollbar-track {
  background: #000000;
}
body::-webkit-scrollbar-thumb {
  background-color: #ffffff;
  border-radius: 10px;
  border: 2px solid #000000;
}

/* Utilitários */
.hidden { display: none !important; }
.flex-1 { flex: 1 1 0%; }
.cursor-pointer { cursor: pointer; }
.text-muted { color: var(--text-muted); font-size: 0.85em; }
.text-danger { color: var(--text-danger) !important; }

/* Header Fixo */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(18, 17, 17, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-container {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px var(--c-orange-glow);
  padding: 4px;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--c-white);
  line-height: 1.15;
}

.brand-title span {
  color: var(--c-orange);
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-white-muted);
}

.cloud-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 0.72rem;
  font-weight: 500;
  color: #34d399;
}

.cloud-status-pill.offline {
  background: var(--c-orange-subtle);
  border-color: var(--c-border);
  color: var(--c-orange);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Busca Global */
.header-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
}

.header-search-wrapper .search-icon {
  position: absolute;
  left: 12px;
  color: var(--c-white-muted);
  pointer-events: none;
}

.header-search-wrapper input {
  width: 100%;
  height: 40px;
  padding: 0 74px 0 38px;
  background: var(--c-black-deep);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-md);
  color: var(--c-white);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.header-search-wrapper input:focus {
  outline: none;
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px rgba(255, 141, 7, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 46px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

.search-kbd-hint {
  position: absolute;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* Ações do Header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Botões */
button {
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  background: var(--c-orange);
  color: #0a0a0a;
  border: none;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: -0.02em;
  transition: all var(--transition-fast);
  box-shadow: 0 0 16px rgba(255, 141, 7, 0.22);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--c-orange-bright);
  box-shadow: 0 0 24px rgba(255, 141, 7, 0.4);
  transform: translateY(-1px);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  background: var(--c-surface);
  color: var(--c-white);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 0.88rem;
  letter-spacing: -0.02em;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border);
  color: var(--c-white);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-surface-raised);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-prominent);
}

.btn-sm {
  height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--c-orange);
  text-decoration: underline;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-link-action {
  background: none;
  border: none;
  color: var(--c-orange);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.btn-link-action:hover {
  text-decoration: underline;
}

/* Dropdown de Configurações */
.settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow-modal);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-align: left;
  width: 100%;
  transition: background var(--transition-fast);
}

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

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* Barra de Filtros / Módulos */
.category-nav-bar {
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 14, 20, 0.7);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-nav-bar::-webkit-scrollbar {
  display: none;
}

.nav-chips-track {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Alternador de Modo de Visualização (Módulos vs Grade Geral) */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.view-toggle-btn.active {
  background: var(--c-orange);
  color: #0a0a0a;
  box-shadow: 0 0 10px rgba(255, 141, 7, 0.25);
}

.view-toggle-btn svg {
  stroke-width: 2.25;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-chip:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.nav-chip.active {
  background: var(--c-orange);
  border-color: var(--c-orange-bright);
  color: #0a0a0a;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(255, 141, 7, 0.25);
}

.nav-chip.active .chip-count {
  background: rgba(0, 0, 0, 0.25);
  color: #0a0a0a;
  font-weight: 700;
}

.chip-count {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 6px;
  border-radius: var(--r-pill);
}

.chips-separator {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  margin: 0 4px;
}

.dynamic-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Layout Principal */
.main-layout {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

/* ═══ XISPEH KICKER & DIVIDERS ═══ */
.ds-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-orange);
  margin-bottom: 6px;
  display: block;
}

.ds-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 28px;
}

.ds-divider--dot::before, .ds-divider--dot::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 141, 7, 0.5), transparent);
}

.ds-divider__dot {
  width: 6px;
  height: 6px;
  background: var(--c-orange);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--c-orange-glow);
}

/* Hero / Welcome Strip Oficial Xispeh */
.welcome-strip {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-card), 0 0 24px rgba(255, 141, 7, 0.06);
  position: relative;
  overflow: hidden;
}

.welcome-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-orange), transparent);
}

.welcome-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.welcome-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--c-white);
  margin-bottom: 6px;
  line-height: 1.15;
}

.welcome-title em {
  font-style: normal;
  color: var(--c-orange);
}

.welcome-desc {
  font-size: 0.9rem;
  color: var(--c-white-mid);
  max-width: 600px;
}

.welcome-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill {
  background: var(--c-black-deep);
  border: 1px solid var(--c-border-subtle);
  padding: 10px 18px;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color var(--transition-fast);
}

.stat-pill:hover {
  border-color: var(--c-border);
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-orange);
  line-height: 1.1;
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--c-white-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Feedback de Busca */
.search-feedback {
  margin-bottom: 24px;
  padding: 12px 18px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   ESTRUTURA DE MÓDULOS / SEÇÕES (ÁREA DE MEMBROS)
   ========================================================================== */

.sections-container {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.section-block {
  background: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-xl);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  position: relative;
}

.section-block:hover {
  border-color: var(--c-border);
}

/* Cabeçalho do Módulo */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title-group,
.section-title-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.section-drag-handle {
  cursor: grab;
  color: var(--c-white-muted);
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.section-drag-handle:hover {
  color: var(--c-orange);
  background: rgba(255, 141, 7, 0.12);
  border-color: rgba(255, 141, 7, 0.25);
}

.section-drag-handle:active {
  cursor: grabbing;
}

.section-color-indicator {
  width: 4px;
  height: 22px;
  border-radius: 4px;
  background-color: var(--c-orange);
  flex-shrink: 0;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--c-white);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.section-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-white-muted);
  background: var(--c-black-deep);
  border: 1px solid var(--c-border-subtle);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-section-action {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--c-white-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-section-action:hover {
  color: var(--c-orange);
  background: var(--c-surface-hover);
  border-color: var(--c-border-subtle);
}

/* Grid de Aplicativos */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  min-height: 90px;
}

.empty-grid-placeholder {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: rgba(10, 10, 10, 0.4);
  border: 1px dashed var(--c-border-subtle);
  border-radius: var(--r-lg);
  color: var(--c-white-muted);
  font-size: 0.88rem;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

/* ==========================================================================
   CARD DO APLICATIVO (CARD ESTILO AULA / PROJETO)
   ========================================================================== */

.app-card {
  background: var(--c-black-deep);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--c-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px var(--c-orange-glow);
}

/* Banner / Capa do Card */
.app-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--c-black-mid);
  overflow: hidden;
  border-bottom: 1px solid var(--c-border-subtle);
}

.app-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.app-card:hover .app-card-img {
  transform: scale(1.03);
}

.app-card-fallback-banner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 141, 7, 0.12) 0%, rgba(18, 17, 17, 0.95) 100%);
  color: var(--c-orange);
}

.app-card-fallback-banner svg {
  opacity: 0.9;
}

/* Badges e Ações sobre a Capa */
.card-media-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.card-drag-grip {
  pointer-events: auto;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border-radius: var(--r-sm);
  padding: 4px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.app-card:hover .card-drag-grip {
  opacity: 1;
}

.card-drag-grip:active {
  cursor: grabbing;
}

.card-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.btn-card-fav {
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  border-radius: var(--r-sm);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-card-fav:hover {
  color: var(--c-orange);
  background: rgba(10, 10, 10, 0.95);
}

.btn-card-fav.active {
  color: var(--c-orange);
}

.btn-card-menu {
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--c-white-mid);
  border-radius: var(--r-sm);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-card-menu:hover {
  background: rgba(10, 10, 10, 0.95);
  color: #ffffff;
}

/* Corpo do Card */
.app-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.app-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.app-card-desc {
  font-size: 0.84rem;
  color: var(--c-white-mid);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-card-desc.is-empty {
  font-style: italic;
  color: var(--c-white-muted);
}

/* Rodapé do Card: Acessar & Editar */
.app-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border-subtle);
}

.btn-card-access {
  flex: 1;
  height: 36px;
  background: var(--c-orange);
  color: #0a0a0a;
  border: none;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: 0 0 10px var(--c-orange-glow);
}

.btn-card-access:hover {
  background: var(--c-orange-bright);
  box-shadow: 0 0 18px rgba(255, 141, 7, 0.35);
}

.btn-card-edit {
  height: 36px;
  padding: 0 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  color: var(--c-white-mid);
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-card-edit:hover {
  background: var(--c-surface-hover);
  color: var(--c-white);
  border-color: var(--c-border);
}

/* Dropdown de Ações do Card */
.card-dropdown-menu {
  position: absolute;
  top: 44px;
  right: 10px;
  width: 170px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: var(--shadow-modal);
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.card-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.card-dropdown-item:hover {
  background: var(--bg-surface-hover);
}

/* Classes de Drag and Drop com SortableJS */
.app-card.sortable-ghost {
  opacity: 0.25;
  background: rgba(255, 141, 7, 0.1) !important;
  border: 2px dashed var(--c-orange) !important;
  border-radius: var(--r-xl) !important;
}

.section-block.sortable-ghost {
  opacity: 0.25;
  background: rgba(255, 141, 7, 0.05) !important;
  border: 2px dashed var(--c-orange) !important;
  border-radius: var(--r-xl) !important;
}

.sortable-chosen {
  cursor: grabbing !important;
}

.app-card.sortable-drag {
  opacity: 0.98;
  transform: scale(1.02);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--c-orange) !important;
  cursor: grabbing !important;
  z-index: 9999;
}

.section-block.sortable-drag {
  opacity: 0.98;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--c-orange) !important;
  cursor: grabbing !important;
  z-index: 9999;
}

/* Estado Vazio */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  max-width: 500px;
  margin: 40px auto;
}

.empty-icon-box {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   MODAIS E FORMULÁRIOS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: modal-enter 200ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-container.modal-sm {
  max-width: 440px;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 141, 7, 0.12);
  color: var(--c-orange);
  border: 1px solid rgba(255, 141, 7, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-badge.color-badge {
  background: rgba(255, 141, 7, 0.12);
  color: var(--c-orange);
  border-color: rgba(255, 141, 7, 0.25);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.modal-form {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 10px 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 141, 7, 0.18);
}

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

.input-with-icon .field-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-input.with-left-icon {
  padding-left: 36px;
}

.field-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.inline-new-section {
  margin-top: 6px;
  padding: 10px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-md);
}

.inline-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Campo Imagem e Prévia */
.image-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.image-inputs-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-file-upload {
  position: relative;
  cursor: pointer;
}

/* Seletor de Tipo de Capa (Abas) */
.cover-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.cover-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-md);
  color: var(--c-white-mid);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cover-tab-btn:hover {
  background: var(--c-surface-hover);
  color: var(--c-white);
  border-color: rgba(255, 255, 255, 0.15);
}

.cover-tab-btn.active {
  background: rgba(255, 141, 7, 0.12);
  border-color: var(--c-orange);
  color: var(--c-orange-bright);
  font-weight: 600;
}

.cover-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Toolbar de Ícones: Busca e Cores */
.icon-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.icon-search-box svg {
  position: absolute;
  left: 10px;
  color: var(--c-white-muted);
  pointer-events: none;
}

.icon-search-box input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-sm);
  color: var(--c-white);
  font-size: 0.8rem;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.icon-search-box input:focus {
  outline: none;
  border-color: var(--c-orange);
  box-shadow: 0 0 0 2px rgba(255, 141, 7, 0.15);
}

.icon-color-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--c-surface);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border-subtle);
}

.icon-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.icon-color-dot:hover {
  transform: scale(1.2);
}

.icon-color-dot.active {
  border-color: #ffffff;
  transform: scale(1.25);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

/* Grade de Ícones da Biblioteca */
.icon-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  padding: 6px;
  background: #0d0c0c;
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-md);
}

.icon-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 56px;
  padding: 4px;
  background: var(--c-surface);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--c-white-mid);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-choice-btn:hover {
  background: var(--c-surface-hover);
  color: var(--c-white);
  border-color: rgba(255, 255, 255, 0.12);
}

.icon-choice-btn.active {
  background: rgba(255, 141, 7, 0.15);
  border-color: var(--c-orange);
  color: var(--c-orange-bright);
}

.icon-choice-label {
  font-size: 0.65rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: -0.02em;
}

/* Prévia da Capa do Card */
.card-cover-preview-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-header-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-white-muted);
}

.preview-card-banner {
  width: 100%;
  height: 100px;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: #0d0c0c;
  border: 1px solid var(--c-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badge de Seção nos Cards na Grade Geral */
.card-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  margin-bottom: 8px;
  width: fit-content;
}

/* Estilo do Grid Geral Único */
.grid-all-apps {
  margin-top: 8px;
}

/* Checkbox Customizado */
.form-checkbox-row {
  margin-top: 4px;
}

.custom-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border-prominent);
  background: var(--bg-surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.custom-checkbox:checked + .checkbox-box {
  background: var(--c-orange);
  border-color: var(--c-orange-bright);
}

.custom-checkbox:checked + .checkbox-box::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.checkbox-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Paleta de Cores */
.color-picker-palette {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.color-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.color-pill:hover {
  transform: scale(1.15);
}

.color-pill.active {
  border-color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Rodapé do Modal */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Modal de Confirmação */
.confirm-content {
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.confirm-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.confirm-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.confirm-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 300px;
}

.confirm-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-prominent);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.toast-success {
  border-left: 4px solid #10b981;
}

.toast.toast-error {
  border-left: 4px solid #ef4444;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Rodapé */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  margin-top: auto;
  padding: 18px 24px;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

.footer-hint {
  font-family: var(--font-mono);
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE & TABLET)
   ========================================================================== */

@media (max-width: 900px) {
  .header-container {
    flex-wrap: wrap;
    padding: 10px 16px;
  }

  .header-search-wrapper {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .header-actions {
    margin-left: auto;
  }

  .welcome-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .welcome-stats {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .main-layout {
    padding: 16px;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .btn-primary span, .btn-secondary span {
    font-size: 0.8rem;
  }

  .btn-primary, .btn-secondary {
    padding: 0 12px;
    height: 38px;
  }

  .modal-container {
    max-height: 96vh;
    border-radius: var(--radius-lg);
  }

  .modal-form {
    padding: 16px;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .section-block {
    padding: 16px;
  }

  .section-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .section-title-group,
  .section-title-wrapper {
    flex: 1 1 100%;
  }

  .section-actions {
    margin-left: auto;
  }

  .brand-title {
    font-size: 0.85rem;
  }

  .icon-picker-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .icon-color-picker {
    justify-content: center;
  }

  .cover-type-tabs {
    flex-direction: column;
  }
}

/* ==========================================================================
   TELA DE AUTENTICAÇÃO / LOGIN OFICIAL XISPEH
   ========================================================================== */

.auth-screen-overlay {
  position: fixed;
  inset: 0;
  background: var(--c-bg);
  background-image: radial-gradient(circle at 50% 35%, rgba(255, 141, 7, 0.14) 0%, transparent 65%);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-black-mid);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 36px 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 25px var(--c-orange-glow);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: modal-enter 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.auth-logo-large {
  width: 58px;
  height: 58px;
  border-radius: var(--r-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--c-orange-glow);
  margin-bottom: 8px;
  padding: 6px;
}

.auth-brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-orange);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--c-white);
  line-height: 1.1;
}

.auth-title em {
  font-style: normal;
  color: var(--c-orange);
}

.auth-subtitle {
  font-size: 0.84rem;
  color: var(--c-white-mid);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-auth-submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  font-size: 0.92rem;
  background: var(--c-orange);
  color: #0a0a0a;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: var(--r-md);
  box-shadow: 0 0 16px rgba(255, 141, 7, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-auth-submit:hover {
  background: var(--c-orange-bright);
  box-shadow: 0 0 24px rgba(255, 141, 7, 0.4);
}

.auth-error-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--text-danger);
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-session-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--c-white-muted);
  text-align: center;
  margin-top: 4px;
}
