/* ==========================================================================
   CORE FEHIVER — Buscador Táctico Global (Ctrl + K) estilo mobiGlas
   ========================================================================== */

.fhv-cmd-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(48px, 10vh, 110px) 16px 24px;
	background: rgba(4, 8, 14, 0.72);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.fhv-cmd-backdrop[hidden] {
	display: none !important;
}

.fhv-cmd-dialog {
	width: 100%;
	max-width: 650px;
	max-height: min(76vh, 620px);
	display: flex;
	flex-direction: column;
	border-radius: 13px;
	background: linear-gradient(180deg, #101925 0%, #0b111a 100%);
	border: 1px solid rgba(101, 184, 201, 0.42);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(101, 184, 201, 0.14);
	overflow: hidden;
	animation: fhvCmdPop 0.14s ease-out;
}

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

.fhv-cmd-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 15px;
	border-bottom: 1px solid rgba(154, 178, 204, 0.16);
	background: rgba(8, 13, 21, 0.7);
}

.fhv-cmd-ico {
	display: inline-flex;
	color: var(--fv-cyan, #65b8c9);
	flex-shrink: 0;
}

.fhv-cmd-input {
	flex: 1 1 auto;
	width: 100%;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	color: #f0f7fd !important;
	font-size: 15px !important;
	padding: 4px 0 !important;
}

.fhv-cmd-input::placeholder {
	color: #778fa7;
}

.fhv-cmd-esc {
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace);
	font-size: 10.5px;
	font-weight: 700;
	padding: 4px 7px;
	border-radius: 5px;
	background: rgba(154, 178, 204, 0.1);
	border: 1px solid rgba(154, 178, 204, 0.24);
	color: #9cb3c9;
	cursor: pointer;
}

.fhv-cmd-esc:hover {
	color: #fff;
	border-color: var(--fv-cyan, #65b8c9);
}

.fhv-cmd-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fhv-cmd-group {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.fhv-cmd-group__title {
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: #6785a1;
	padding: 4px 10px 3px;
}

.fhv-cmd-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 9px 11px;
	border-radius: 8px;
	text-decoration: none !important;
	border: 1px solid transparent;
	background: transparent;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

.fhv-cmd-item:hover,
.fhv-cmd-item.is-selected {
	background: rgba(101, 184, 201, 0.13);
	border-color: rgba(101, 184, 201, 0.34);
}

.fhv-cmd-item__left {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.fhv-cmd-item__thumb {
	width: 44px;
	height: 28px;
	border-radius: 5px;
	object-fit: cover;
	background: #0a1018;
	border: 1px solid rgba(154, 178, 204, 0.22);
	flex-shrink: 0;
}

.fhv-cmd-item__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.fhv-cmd-item__title {
	font-size: 13.5px;
	font-weight: 700;
	color: #eef6fd;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fhv-cmd-item__sub {
	font-size: 12px;
	color: #8fa6bc;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fhv-cmd-item__badge {
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace);
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	padding: 2px 7px;
	border-radius: 4px;
	background: rgba(101, 184, 201, 0.13);
	border: 1px solid rgba(101, 184, 201, 0.3);
	color: #86d4e4;
	white-space: nowrap;
	flex-shrink: 0;
}

.fhv-cmd-item__badge.is-ext {
	background: rgba(226, 189, 116, 0.12);
	border-color: rgba(226, 189, 116, 0.32);
	color: #f0cf88;
}

.fhv-cmd-empty {
	padding: 24px 16px;
	text-align: center;
	font-size: 13.5px;
	color: #8ba2b8;
}

.fhv-cmd-foot {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
	padding: 9px 14px;
	border-top: 1px solid rgba(154, 178, 204, 0.14);
	background: rgba(7, 11, 18, 0.86);
	font-size: 11.5px;
	color: #7c93aa;
}

.fhv-cmd-foot kbd {
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace);
	font-size: 10px;
	padding: 1px 5px;
	margin-right: 4px;
	border-radius: 4px;
	background: rgba(154, 178, 204, 0.12);
	border: 1px solid rgba(154, 178, 204, 0.22);
	color: #bfd2e4;
}

.fhv-cmd-foot__brand {
	margin-left: auto;
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--fv-cyan, #65b8c9);
}


/* ==========================================================================
   CORE FEHIVER v3.0 — Blindaje CSS de Raíl Ctrl+K, Lienzo Ancho y Portada Dual
   (Alojado aquí con alta especificidad para aislarlo de estilos base de BuddyX)
   ========================================================================== */

/* 1. Lienzo ancho completo en páginas de herramientas y catálogos (coherente con Home) */
body.fehiver-scifi-theme .fhv-shell-page--wide .bn-app__region {
	display: block !important;
	grid-template-columns: minmax(0, 1fr) !important;
	width: 100% !important;
}

body.fehiver-scifi-theme .fhv-shell-page--wide .fhv-shell-page__main {
	max-width: none !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 24px 30px 44px !important;
}

@media (max-width: 768px) {
	body.fehiver-scifi-theme .fhv-shell-page--wide .fhv-shell-page__main {
		padding: 14px 12px 32px !important;
	}
}

/* 2. Botón Ctrl+K del raíl izquierdo (inmune a estilos button de BuddyX) */
body.fehiver-scifi-theme .fhv-rail-cmd-wrap {
	padding: 4px 10px 10px !important;
	margin: 0 !important;
}

body.fehiver-scifi-theme button.fhv-rail-cmd-btn {
	-webkit-appearance: none !important;
	appearance: none !important;
	width: 100% !important;
	height: 36px !important;
	min-height: 36px !important;
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 8px !important;
	padding: 0 10px !important;
	margin: 0 !important;
	border-radius: 8px !important;
	background: linear-gradient(180deg, rgba(16, 26, 39, 0.96), rgba(10, 17, 26, 0.98)) !important;
	border: 1px solid rgba(101, 184, 201, 0.34) !important;
	box-shadow: inset 0 1px 0 rgba(142, 224, 240, 0.08) !important;
	color: #a9c0d6 !important;
	font-family: var(--fv-font-sans, "Inter", sans-serif) !important;
	font-size: 12.2px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	text-align: left !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	cursor: pointer !important;
	overflow: hidden !important;
	transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease !important;
}

body.fehiver-scifi-theme button.fhv-rail-cmd-btn:hover,
body.fehiver-scifi-theme button.fhv-rail-cmd-btn:focus-visible {
	border-color: #65b8c9 !important;
	background: linear-gradient(180deg, rgba(22, 36, 54, 0.98), rgba(13, 22, 34, 0.98)) !important;
	color: #f0f7fd !important;
	outline: none !important;
}

body.fehiver-scifi-theme button.fhv-rail-cmd-btn .bn-rail__icon {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 16px !important;
	height: 16px !important;
	color: #65b8c9 !important;
	flex: 0 0 16px !important;
}

body.fehiver-scifi-theme .fhv-rail-cmd-btn__lbl {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
}

body.fehiver-scifi-theme .fhv-rail-cmd-btn__kbd {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	white-space: nowrap !important;
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace) !important;
	font-size: 9.5px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	padding: 3px 6px !important;
	margin: 0 !important;
	border-radius: 4px !important;
	background: rgba(101, 184, 201, 0.16) !important;
	border: 1px solid rgba(101, 184, 201, 0.36) !important;
	color: #8ee0f0 !important;
}

html[data-bn-rail="collapsed"] body.fehiver-scifi-theme button.fhv-rail-cmd-btn {
	justify-content: center !important;
	padding: 0 !important;
}

html[data-bn-rail="collapsed"] body.fehiver-scifi-theme .fhv-rail-cmd-btn__lbl,
html[data-bn-rail="collapsed"] body.fehiver-scifi-theme .fhv-rail-cmd-btn__kbd {
	display: none !important;
}

/* 3. Portada Dual — Command Deck táctico para visitantes */
body.fehiver-scifi-theme .fhv-home-deck {
	display: flex !important;
	flex-direction: column !important;
	gap: 15px !important;
	margin: 14px 0 10px !important;
	padding: 18px 20px !important;
	border-radius: 12px !important;
	background:
		radial-gradient(ellipse 75% 100% at 100% 0%, rgba(101, 184, 201, 0.13), transparent 62%),
		radial-gradient(ellipse 65% 90% at 0% 100%, rgba(100, 184, 140, 0.08), transparent 60%),
		linear-gradient(180deg, rgba(14, 22, 33, 0.96), rgba(10, 16, 24, 0.98)) !important;
	border: 1px solid rgba(101, 184, 201, 0.28) !important;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
}

body.fehiver-scifi-theme .fhv-home-deck__head {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 14px !important;
	flex-wrap: wrap !important;
}

body.fehiver-scifi-theme .fhv-home-deck__kicker {
	display: block !important;
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace) !important;
	font-size: 10.5px !important;
	font-weight: 700 !important;
	letter-spacing: 0.1em !important;
	color: #65b8c9 !important;
	margin: 0 0 4px !important;
}

body.fehiver-scifi-theme .fhv-home-deck__title {
	margin: 0 !important;
	font-size: 17.5px !important;
	font-weight: 700 !important;
	color: #f1f7fd !important;
	line-height: 1.3 !important;
}

body.fehiver-scifi-theme .fhv-home-deck__auth {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	flex-wrap: wrap !important;
}

body.fehiver-scifi-theme a.fhv-home-deck__btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 8px 14px !important;
	border-radius: 7px !important;
	font-size: 12.8px !important;
	font-weight: 700 !important;
	line-height: 1.1 !important;
	text-decoration: none !important;
	background: rgba(154, 178, 204, 0.10) !important;
	border: 1px solid rgba(154, 178, 204, 0.28) !important;
	color: #d6e4f2 !important;
	transition: all 0.16s ease !important;
}

body.fehiver-scifi-theme a.fhv-home-deck__btn:hover {
	border-color: #65b8c9 !important;
	color: #ffffff !important;
}

body.fehiver-scifi-theme a.fhv-home-deck__btn--primary {
	background: linear-gradient(135deg, rgba(101, 184, 201, 0.28), rgba(101, 184, 201, 0.14)) !important;
	border-color: rgba(101, 184, 201, 0.56) !important;
	color: #f4fbff !important;
}

body.fehiver-scifi-theme a.fhv-home-deck__btn--primary:hover {
	background: linear-gradient(135deg, rgba(101, 184, 201, 0.40), rgba(101, 184, 201, 0.22)) !important;
}

body.fehiver-scifi-theme .fhv-home-deck__grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 11px !important;
}

@media (max-width: 1120px) {
	body.fehiver-scifi-theme .fhv-home-deck__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 600px) {
	body.fehiver-scifi-theme .fhv-home-deck__grid {
		grid-template-columns: 1fr !important;
	}
}

body.fehiver-scifi-theme a.fhv-deck-tile {
	display: flex !important;
	flex-direction: column !important;
	gap: 6px !important;
	padding: 13px 14px !important;
	border-radius: 9px !important;
	background: rgba(8, 13, 21, 0.84) !important;
	border: 1px solid rgba(154, 178, 204, 0.18) !important;
	text-decoration: none !important;
	transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease !important;
}

body.fehiver-scifi-theme a.fhv-deck-tile:hover {
	transform: translateY(-2px) !important;
	background: rgba(15, 24, 36, 0.96) !important;
}

body.fehiver-scifi-theme .fhv-deck-tile__top {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 8px !important;
}

body.fehiver-scifi-theme .fhv-deck-tile__ico {
	display: inline-flex !important;
	align-items: center !important;
	color: #65b8c9 !important;
}

body.fehiver-scifi-theme .fhv-deck-tile__tag {
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace) !important;
	font-size: 9.5px !important;
	font-weight: 700 !important;
	letter-spacing: 0.06em !important;
	padding: 2px 6px !important;
	border-radius: 4px !important;
	background: rgba(101, 184, 201, 0.15) !important;
	color: #88d5e5 !important;
}

body.fehiver-scifi-theme a.fhv-deck-tile strong {
	display: block !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	color: #f1f7fd !important;
	line-height: 1.25 !important;
}

body.fehiver-scifi-theme a.fhv-deck-tile > span:last-child {
	display: block !important;
	font-size: 12px !important;
	line-height: 1.45 !important;
	color: #9bb1c7 !important;
}

body.fehiver-scifi-theme a.fhv-deck-tile--cyan:hover { border-color: rgba(101, 184, 201, 0.58) !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--green .fhv-deck-tile__ico { color: #7ee2ae !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--green .fhv-deck-tile__tag { background: rgba(100, 184, 140, 0.16) !important; color: #8ee0b4 !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--green:hover { border-color: rgba(100, 184, 140, 0.58) !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--amber .fhv-deck-tile__ico { color: #e2bd74 !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--amber .fhv-deck-tile__tag { background: rgba(226, 189, 116, 0.15) !important; color: #f0cf88 !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--amber:hover { border-color: rgba(226, 189, 116, 0.58) !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--red .fhv-deck-tile__ico { color: #e07b7b !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--red .fhv-deck-tile__tag { background: rgba(217, 107, 107, 0.16) !important; color: #f09595 !important; }
body.fehiver-scifi-theme a.fhv-deck-tile--red:hover { border-color: rgba(217, 107, 107, 0.58) !important; }

/* 4. Cockpit compacto para miembros conectados */
body.fehiver-scifi-theme .fhv-home-cockpit {
	display: flex !important;
	align-items: center !important;
	flex-wrap: wrap !important;
	gap: 7px !important;
	margin: 12px 0 8px !important;
	padding: 10px 12px !important;
	border-radius: 10px !important;
	background: rgba(11, 18, 27, 0.88) !important;
	border: 1px solid rgba(101, 184, 201, 0.22) !important;
}

body.fehiver-scifi-theme .fhv-cockpit-chip {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	padding: 6px 11px !important;
	border-radius: 7px !important;
	background: rgba(18, 27, 39, 0.92) !important;
	border: 1px solid rgba(154, 178, 204, 0.20) !important;
	color: #d2e1ef !important;
	font-size: 12.2px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	cursor: pointer !important;
	transition: all 0.15s ease !important;
}

body.fehiver-scifi-theme .fhv-cockpit-chip:hover {
	border-color: #65b8c9 !important;
	background: rgba(101, 184, 201, 0.16) !important;
	color: #ffffff !important;
}

body.fehiver-scifi-theme .fhv-cockpit-chip.is-cyan svg { color: #65b8c9 !important; }
body.fehiver-scifi-theme .fhv-cockpit-chip.is-amber svg { color: #e2bd74 !important; }
body.fehiver-scifi-theme .fhv-cockpit-chip.is-green svg { color: #7ee2ae !important; }
body.fehiver-scifi-theme .fhv-cockpit-chip.is-red svg { color: #e07b7b !important; }

body.fehiver-scifi-theme button.fhv-cockpit-chip--cmd {
	margin-left: auto !important;
	border-color: rgba(101, 184, 201, 0.36) !important;
	background: rgba(101, 184, 201, 0.12) !important;
}

body.fehiver-scifi-theme button.fhv-cockpit-chip--cmd kbd {
	font-family: var(--fv-font-mono, "JetBrains Mono", monospace) !important;
	font-size: 10px !important;
	padding: 2px 5px !important;
	border-radius: 4px !important;
	background: rgba(8, 13, 21, 0.78) !important;
	color: #8ed9e8 !important;
}
